From 5dd4936b40a6ebbf6a1ee234d5e559e168cde004 Mon Sep 17 00:00:00 2001 From: Petr Parolek Date: Tue, 9 Mar 2021 17:20:14 +0100 Subject: [PATCH 1/2] unify syntax in readmes --- .docs/README.md | 10 +++++----- README.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.docs/README.md b/.docs/README.md index 0f1c138..6356a84 100644 --- a/.docs/README.md +++ b/.docs/README.md @@ -22,7 +22,7 @@ composer require contributte/codeception When you want to write an integration test to make sure that some services work well together you need to create the DI container first. -```yml +```yaml # /tests/integration.suite.yml error_level: "E_ALL" class_name: IntegrationSuiteTester @@ -42,7 +42,7 @@ modules: # newContainerForEachTest: true ``` -```yml +```yaml # /tests/integration/config/config.neon services: - MyService @@ -62,7 +62,7 @@ class MyServiceTest extends Unit } } ``` -`useConfigFiles` method takes array of file paths that are either absolute or relative to suite root. +`useConfigFiles` method takes array of file paths that are either absolute or relative to suite root. ### NetteApplicationModule @@ -70,7 +70,7 @@ In functional tests you want to emulate the HTTP request and run `Nette\Applicat Unfortunately Nette framework has some downsides like the fact that Request and Response are registered as services in the DI Container. For this reason the NetteApplicationModule requires `Contributte\Codeception\DI\CodeceptionExtension` to override the default implementations. **Beware that this is meant for the functional tests only. Do NOT register the extension outside of tests.** -```yml +```yaml # /tests/functional.suite.yml error_level: "E_ALL" class_name: FunctionalSuiteTester @@ -86,7 +86,7 @@ modules: - config/config.neon ``` -```yml +```yaml # /tests/functional/config/config.neon extensions: codeception: Contributte\Codeception\DI\HttpExtension diff --git a/README.md b/README.md index 5e34ead..c40d74f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To install latest version of `contributte/codeception` use [Composer](https://getcomposer.com). -``` +```bash composer require contributte/codeception ``` From 743aa3e2669ae29dd32fd612c1541067dae64685 Mon Sep 17 00:00:00 2001 From: Petr Parolek Date: Wed, 10 Mar 2021 17:16:16 +0100 Subject: [PATCH 2/2] unify syntax in readmes - use 4 spaces in CSS, in JS, in HTML and in Latte - use tab in NEON and in PHP - neon highlighting syntax - normalized filename of Readmes - typos --- .docs/README.md | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.docs/README.md b/.docs/README.md index 6356a84..c4146e6 100644 --- a/.docs/README.md +++ b/.docs/README.md @@ -6,8 +6,8 @@ This library is here to help you with Integration and [Functional Tests](http:// - [Setup](#setup) - [Usage](#usage) - - [DI module - Nette\DI integration](#nettedimodule) - - [Application module - Nette\Application integration](#netteapplicationmodule) + - [DI module - Nette\DI integration](#nettedimodule) + - [Application module - Nette\Application integration](#netteapplicationmodule) - [Development](#development) ## Setup @@ -42,24 +42,25 @@ modules: # newContainerForEachTest: true ``` -```yaml +```neon # /tests/integration/config/config.neon services: - - MyService + - MyService ``` ```php # /tests/integration/src/MyServiceTest.php use Codeception\Test\Unit; + class MyServiceTest extends Unit { - public function testMyService(): void - { - // Here you can override the configFiles from integration.suite.yml if needed. - // The newContainerForEachTest option is required for this. - // $this->tester->useConfigFiles(['config/another-config.neon']); - $this->assertInstanceOf(MyService::class, $this->tester->grabService(MyService::class)); - } + public function testMyService(): void + { + // Here you can override the configFiles from integration.suite.yml if needed. + // The newContainerForEachTest option is required for this. + // $this->tester->useConfigFiles(['config/another-config.neon']); + $this->assertInstanceOf(MyService::class, $this->tester->grabService(MyService::class)); + } } ``` `useConfigFiles` method takes array of file paths that are either absolute or relative to suite root. @@ -86,10 +87,10 @@ modules: - config/config.neon ``` -```yaml +```neon # /tests/functional/config/config.neon extensions: - codeception: Contributte\Codeception\DI\HttpExtension + codeception: Contributte\Codeception\DI\HttpExtension ``` ```php @@ -97,14 +98,14 @@ extensions: use Codeception\Test\Unit; class HomepageTest extends Unit { - public function testHomepage(): void - { - // Create http request and run Nette\Application\Application. See Contributte\Codeception\Connector\NetteConnector for details. - $this->tester->amOnPage('/'); - // Assert that the response is what you expect. - $this->tester->seeResponseCodeIs(200); - $this->tester->see('Hello World!', 'h1'); - } + public function testHomepage(): void + { + // Create http request and run Nette\Application\Application. See Contributte\Codeception\Connector\NetteConnector for details. + $this->tester->amOnPage('/'); + // Assert that the response is what you expect. + $this->tester->seeResponseCodeIs(200); + $this->tester->see('Hello World!', 'h1'); + } } ``` @@ -116,7 +117,7 @@ Simply run scripts in `Makefile` and make sure that qa, tester and phpstan passe You can use these commands to do more specific tasks. -``` +```bash # generate necessary files to run the tests ./vendor/bin/codecept build