Fix phpcs

This commit is contained in:
Laurent Destailleur 2018-09-28 18:09:07 +02:00
parent 492b9c1a03
commit 73458f649f

View File

@ -20,8 +20,6 @@
* \file test/functional/TakePosFunctionalTest.php * \file test/functional/TakePosFunctionalTest.php
* \ingroup takepos * \ingroup takepos
* \brief Example Selenium test. * \brief Example Selenium test.
*
* Put detailed description here.
*/ */
namespace test\functional; namespace test\functional;
@ -99,6 +97,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Global test setup * Global test setup
*
* @return void
*/ */
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
@ -106,6 +106,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Unit test setup * Unit test setup
*
* @return void
*/ */
public function setUp() public function setUp()
{ {
@ -115,6 +117,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Verify pre conditions * Verify pre conditions
*
* @return void
*/ */
protected function assertPreConditions() protected function assertPreConditions()
{ {
@ -122,6 +126,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Handle Dolibarr authentication * Handle Dolibarr authentication
*
* @return void
*/ */
private function authenticate() private function authenticate()
{ {
@ -142,6 +148,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Test enabling developer mode * Test enabling developer mode
*
* @return void
*/ */
public function testEnableDeveloperMode() public function testEnableDeveloperMode()
{ {
@ -154,12 +162,14 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
$this->byName('update')->click(); $this->byName('update')->click();
// Page reloaded, we need a new XPath // Page reloaded, we need a new XPath
$main_features_level = $this->byXPath($main_features_level_path); $main_features_level = $this->byXPath($main_features_level_path);
return $this->assertEquals('2', $main_features_level->value(), "MAIN_FEATURES_LEVEL value is 2"); $this->assertEquals('2', $main_features_level->value(), "MAIN_FEATURES_LEVEL value is 2");
} }
/** /**
* Test enabling the module * Test enabling the module
* *
* @return void
*
* @depends testEnableDeveloperMode * @depends testEnableDeveloperMode
*/ */
public function testModuleEnabled() public function testModuleEnabled()
@ -179,43 +189,49 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
} }
// Page reloaded, we need a new Xpath // Page reloaded, we need a new Xpath
$module_status_image = $this->byXPath($module_status_image_path); $module_status_image = $this->byXPath($module_status_image_path);
return $this->assertContains('switch_on.png', $module_status_image->attribute('src'), "Module enabled"); $this->assertContains('switch_on.png', $module_status_image->attribute('src'), "Module enabled");
} }
/** /**
* Test access to the configuration page * Test access to the configuration page
* *
* @return void
*
* @depends testModuleEnabled * @depends testModuleEnabled
*/ */
public function testConfigurationPage() public function testConfigurationPage()
{ {
$this->url('/custom/takepos/admin/setup.php'); $this->url('/custom/takepos/admin/setup.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains('takepos/admin/setup.php', $this->url(), 'Configuration page'); $this->assertContains('takepos/admin/setup.php', $this->url(), 'Configuration page');
} }
/** /**
* Test access to the about page * Test access to the about page
* *
* @return void
*
* @depends testConfigurationPage * @depends testConfigurationPage
*/ */
public function testAboutPage() public function testAboutPage()
{ {
$this->url('/custom/takepos/admin/about.php'); $this->url('/custom/takepos/admin/about.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains('takepos/admin/about.php', $this->url(), 'About page'); $this->assertContains('takepos/admin/about.php', $this->url(), 'About page');
} }
/** /**
* Test about page is rendering Markdown * Test about page is rendering Markdown
* *
* @return void
*
* @depends testAboutPage * @depends testAboutPage
*/ */
public function testAboutPageRendersMarkdownReadme() public function testAboutPageRendersMarkdownReadme()
{ {
$this->url('/custom/takepos/admin/about.php'); $this->url('/custom/takepos/admin/about.php');
$this->authenticate(); $this->authenticate();
return $this->assertEquals( $this->assertEquals(
'Dolibarr Module Template (aka My Module)', 'Dolibarr Module Template (aka My Module)',
$this->byTag('h1')->text(), $this->byTag('h1')->text(),
"Readme title" "Readme title"
@ -225,25 +241,29 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Test box is properly declared * Test box is properly declared
* *
* @return void
*
* @depends testModuleEnabled * @depends testModuleEnabled
*/ */
public function testBoxDeclared() public function testBoxDeclared()
{ {
$this->url('/admin/boxes.php'); $this->url('/admin/boxes.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains('takeposwidget1', $this->source(), "Box enabled"); $this->assertContains('takeposwidget1', $this->source(), "Box enabled");
} }
/** /**
* Test trigger is properly enabled * Test trigger is properly enabled
* *
* @return void
*
* @depends testModuleEnabled * @depends testModuleEnabled
*/ */
public function testTriggerDeclared() public function testTriggerDeclared()
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( $this->assertContains(
'interface_99_modTakePos_TakePosTriggers.class.php', 'interface_99_modTakePos_TakePosTriggers.class.php',
$this->byTag('body')->text(), $this->byTag('body')->text(),
"Trigger declared" "Trigger declared"
@ -253,13 +273,15 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Test trigger is properly declared * Test trigger is properly declared
* *
* @return void
*
* @depends testTriggerDeclared * @depends testTriggerDeclared
*/ */
public function testTriggerEnabled() public function testTriggerEnabled()
{ {
$this->url('/admin/triggers.php'); $this->url('/admin/triggers.php');
$this->authenticate(); $this->authenticate();
return $this->assertContains( $this->assertContains(
'tick.png', 'tick.png',
$this->byXPath('//td[text()="interface_99_modTakePos_MyTrigger.class.php"]/following::img')->attribute('src'), $this->byXPath('//td[text()="interface_99_modTakePos_MyTrigger.class.php"]/following::img')->attribute('src'),
"Trigger enabled" "Trigger enabled"
@ -268,6 +290,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Verify post conditions * Verify post conditions
*
* @return void
*/ */
protected function assertPostConditions() protected function assertPostConditions()
{ {
@ -275,6 +299,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Unit test teardown * Unit test teardown
*
* @return void
*/ */
public function tearDown() public function tearDown()
{ {
@ -282,6 +308,8 @@ class TakePosFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase
/** /**
* Global test teardown * Global test teardown
*
* @return void
*/ */
public static function tearDownAfterClass() public static function tearDownAfterClass()
{ {