From 9a1677017127ec5b090fdc03d01acad093020f2d Mon Sep 17 00:00:00 2001 From: Jerome De Almeida Date: Thu, 12 May 2016 10:21:01 +0200 Subject: [PATCH 1/3] config --- config/autoload/config.local.php.dist | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 config/autoload/config.local.php.dist diff --git a/config/autoload/config.local.php.dist b/config/autoload/config.local.php.dist new file mode 100755 index 0000000..9912788 --- /dev/null +++ b/config/autoload/config.local.php.dist @@ -0,0 +1,10 @@ + [ + 1 => 'Français', + 2 => 'English', + 3 => 'Deutsch' + ], + 'defaultLanguageIndex' => 2 +]; From c69e73b2e72a2a9af5603d737122778e3bc8f7c5 Mon Sep 17 00:00:00 2001 From: Guillaume Lesniak Date: Thu, 12 May 2016 10:23:13 +0200 Subject: [PATCH 2/3] config: language => languages --- config/autoload/config.local.php.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/autoload/config.local.php.dist b/config/autoload/config.local.php.dist index 9912788..ea39bdf 100755 --- a/config/autoload/config.local.php.dist +++ b/config/autoload/config.local.php.dist @@ -1,7 +1,7 @@ [ + 'languages' => [ 1 => 'Français', 2 => 'English', 3 => 'Deutsch' From 387f4fce7075e9e274f417778ca8dda8d6228587 Mon Sep 17 00:00:00 2001 From: Jerome De Almeida Date: Tue, 17 May 2016 16:05:44 +0200 Subject: [PATCH 3/3] add functionnal testing --- behat.yml | 9 ++++ composer.json | 9 +++- features/amv.feature | 65 ++++++++++++++++++++++++++ features/bootstrap/AmvContext.php | 77 +++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100755 behat.yml create mode 100755 features/amv.feature create mode 100644 features/bootstrap/AmvContext.php diff --git a/behat.yml b/behat.yml new file mode 100755 index 0000000..f2357a0 --- /dev/null +++ b/behat.yml @@ -0,0 +1,9 @@ +default: + extensions: + Behat\MinkExtension: + base_url: http://127.0.0.1:8080 + goutte: ~ + suites: + features: + paths: [ %paths.base%/features ] + contexts: [ AmvContext ] \ No newline at end of file diff --git a/composer.json b/composer.json index 87dcc7a..a7f5ba6 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,14 @@ "php": ">=5.5", "zendframework/zendframework": "2.5.3", "doctrine/doctrine-orm-module": "^0.10", - "doctrine/migrations": "^1.4" + "doctrine/migrations": "^1.4", + "behat/behat": "~3.0", + "behat/mink": "^1.6", + "behat/mink-extension": "^2.0", + "behat/mink-goutte-driver": "^1.1" + }, + "config": { + "bin-dir": "bin/" }, "repositories":[ { diff --git a/features/amv.feature b/features/amv.feature new file mode 100755 index 0000000..a1194b2 --- /dev/null +++ b/features/amv.feature @@ -0,0 +1,65 @@ +@amvService +Feature: Amvs services + Test complies for amv service + +Scenario Outline: Test complies requirements + Given That I want to call the amv service + And I should test complies with Amode and Tmode and Vmode and Amodel and Tmodel and Vmodel and IsRegulator and the Result is + +Examples: + | a_mode | t_mode | v_mode | a_model | t_model | v_model | is_regulator | result | + | 0 | 0 | 0 | 1 | 1 | 1 | 0 | true | + | 0 | 0 | 0 | 1 | 1 | 1 | 1 | true | + | 0 | 0 | 0 | 1 | 1 | 2 | 0 | true | + | 0 | 0 | 0 | 1 | 1 | 2 | 1 | true | + | 0 | 0 | 0 | 1 | 2 | 3 | 0 | true | + | 0 | 0 | 0 | 1 | 2 | 3 | 1 | true | + + | 0 | 0 | 1 | 1 | 1 | 1 | 0 | false | + | 0 | 0 | 1 | 1 | 1 | 1 | 1 | false | + | 0 | 0 | 1 | 1 | 1 | 2 | 0 | false | + | 0 | 0 | 1 | 1 | 1 | 2 | 1 | false | + | 0 | 0 | 1 | 1 | 2 | 3 | 0 | false | + | 0 | 0 | 1 | 1 | 2 | 3 | 1 | false | + + | 0 | 1 | 0 | 1 | 1 | 1 | 0 | false | + | 0 | 1 | 0 | 1 | 1 | 1 | 1 | false | + | 0 | 1 | 0 | 1 | 1 | 2 | 0 | false | + | 0 | 1 | 0 | 1 | 1 | 2 | 1 | false | + | 0 | 1 | 0 | 1 | 2 | 3 | 0 | false | + | 0 | 1 | 0 | 1 | 2 | 3 | 1 | false | + + | 1 | 0 | 0 | 1 | 1 | 1 | 0 | true | + | 1 | 0 | 0 | 1 | 1 | 1 | 1 | false | + | 1 | 0 | 0 | 1 | 1 | 2 | 0 | true | + | 1 | 0 | 0 | 1 | 1 | 2 | 1 | false | + | 1 | 0 | 0 | 1 | 2 | 3 | 0 | true | + | 1 | 0 | 0 | 1 | 2 | 3 | 1 | false | + + | 1 | 1 | 0 | 1 | 1 | 1 | 0 | true | + | 1 | 1 | 0 | 1 | 1 | 1 | 1 | false | + | 1 | 1 | 0 | 1 | 1 | 2 | 0 | true | + | 1 | 1 | 0 | 1 | 1 | 2 | 1 | false | + | 1 | 1 | 0 | 1 | 2 | 3 | 0 | true | + | 1 | 1 | 0 | 1 | 2 | 3 | 1 | false | + + | 1 | 0 | 1 | 1 | 1 | 1 | 0 | true | + | 1 | 0 | 1 | 1 | 1 | 1 | 1 | false | + | 1 | 0 | 1 | 1 | 1 | 2 | 0 | true | + | 1 | 0 | 1 | 1 | 1 | 2 | 1 | false | + | 1 | 0 | 1 | 1 | 2 | 3 | 0 | true | + | 1 | 0 | 1 | 1 | 2 | 3 | 1 | false | + + | 0 | 1 | 1 | 1 | 1 | 1 | 0 | false | + | 0 | 1 | 1 | 1 | 1 | 1 | 1 | false | + | 0 | 1 | 1 | 1 | 1 | 2 | 0 | false | + | 0 | 1 | 1 | 1 | 1 | 2 | 1 | false | + | 0 | 1 | 1 | 1 | 2 | 3 | 0 | false | + | 0 | 1 | 1 | 1 | 2 | 3 | 1 | false | + + | 1 | 1 | 1 | 1 | 1 | 1 | 0 | true | + | 1 | 1 | 1 | 1 | 1 | 1 | 1 | true | + | 1 | 1 | 1 | 1 | 1 | 2 | 0 | false | + | 1 | 1 | 1 | 1 | 1 | 2 | 1 | false | + | 1 | 1 | 1 | 1 | 2 | 3 | 0 | false | + | 1 | 1 | 1 | 1 | 2 | 3 | 1 | false | diff --git a/features/bootstrap/AmvContext.php b/features/bootstrap/AmvContext.php new file mode 100644 index 0000000..581855f --- /dev/null +++ b/features/bootstrap/AmvContext.php @@ -0,0 +1,77 @@ +service = new \MonarcCore\Service\AmvService(); + } + + + /** + * @Given I should test complies with Amode :arg1 and Tmode :arg2 and Vmode :arg3 and Amodel :arg4 and Tmodel :arg5 and Vmodel :arg6 and IsRegulator :arg7 and the Result is true + */ + public function iShouldTestCompliesWithAmodeAndTmodeAndVmodeAndAmodelAndTmodelAndVmodelAndIsregulatorAndTheResultIsTrue($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7) + { + $service = $this->service; + + $result = $service->compliesControl($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7); + + PHPUnit_Framework_Assert::assertTrue($result); + } + + /** + * @Given I should test complies with Amode :arg1 and Tmode :arg2 and Vmode :arg3 and Amodel :arg4 and Tmodel :arg5 and Vmodel :arg6 and IsRegulator :arg7 and the Result is false + */ + public function iShouldTestCompliesWithAmodeAndTmodeAndVmodeAndAmodelAndTmodelAndVmodelAndIsregulatorAndTheResultIsFalse($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7) + { + $service = $this->service; + + $result = $service->compliesControl($arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7); + + PHPUnit_Framework_Assert::assertFalse($result); + } + +}