Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 1dcec4b

Browse files
committed
Minor codestyle improvements and unifications
1 parent 5135379 commit 1dcec4b

30 files changed

+90
-76
lines changed

.php_cs.dist

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ return PhpCsFixer\Config::create()
1313
'concat_space' => ['spacing' => 'one'],
1414
'function_typehint_space' => true,
1515
'general_phpdoc_annotation_remove' => ['author'],
16+
'implode_call' => true,
17+
'is_null' => true,
1618
'linebreak_after_opening_tag' => true,
1719
'lowercase_cast' => true,
1820
'mb_str_functions' => true,
@@ -51,9 +53,15 @@ return PhpCsFixer\Config::create()
5153
'ordered_imports' => true,
5254
'php_unit_construct' => true,
5355
'php_unit_dedicate_assert' => true,
54-
'php_unit_expectation' => true,
56+
'php_unit_expectation' => ['target' => '5.6'],
57+
'php_unit_method_casing' => ['case' => 'camel_case'],
5558
'php_unit_mock' => true,
59+
'php_unit_mock_short_will_return' => true,
60+
'php_unit_namespaced' => ['target' => '5.7'],
5661
'php_unit_no_expectation_annotation' => true,
62+
'php_unit_ordered_covers' => true,
63+
'php_unit_set_up_tear_down_visibility' => true,
64+
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
5765
'phpdoc_add_missing_param_annotation' => true,
5866
'phpdoc_indent' => true,
5967
'phpdoc_no_access' => true,

phpstan.neon

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
parameters:
2-
ignoreErrors:
3-
- '#Class Symfony\\Component\\Process\\ProcessBuilder not found.#'
4-
- '#Instantiated class Symfony\\Component\\Process\\ProcessBuilder not found.#'
5-
- '#Call to method setPrefix\(\) on an unknown class Symfony\\Component\\Process\\ProcessBuilder#'
2+
ignoreErrors:
3+
- '#Class Symfony\\Component\\Process\\ProcessBuilder not found.#'
4+
- '#Instantiated class Symfony\\Component\\Process\\ProcessBuilder not found.#'
5+
- '#Call to method setPrefix\(\) on an unknown class Symfony\\Component\\Process\\ProcessBuilder#'
66
# To be fixed:
7-
- '#Call to an undefined method RecursiveIteratorIterator::getSubPathName\(\)#'
8-
- '#Call to an undefined method Facebook\\WebDriver\\WebDriver::getTouch\(\)#'
9-
- '#Call to an undefined method Facebook\\WebDriver\\WebDriverElement::getCoordinates\(\)#'
10-
- '#Call to an undefined method Facebook\\WebDriver\\WebDriverElement::equals\(\)#'
7+
- '#Call to an undefined method RecursiveIteratorIterator::getSubPathName\(\)#'
8+
- '#Call to an undefined method Facebook\\WebDriver\\WebDriver::getTouch\(\)#'
9+
- '#Call to an undefined method Facebook\\WebDriver\\WebDriverElement::getCoordinates\(\)#'
10+
- '#Call to an undefined method Facebook\\WebDriver\\WebDriverElement::equals\(\)#'

tests/functional/RemoteWebDriverCreateTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
use Facebook\WebDriver\Remote\RemoteWebDriver;
2121

2222
/**
23-
* @covers \Facebook\WebDriver\Remote\RemoteWebDriver
2423
* @covers \Facebook\WebDriver\Remote\HttpCommandExecutor
24+
* @covers \Facebook\WebDriver\Remote\RemoteWebDriver
2525
*/
2626
class RemoteWebDriverCreateTest extends WebDriverTestCase
2727
{

tests/functional/RemoteWebDriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public function testShouldGetPageTitle()
3838
}
3939

4040
/**
41-
* @covers ::getCurrentURL
4241
* @covers ::get
42+
* @covers ::getCurrentURL
4343
*/
4444
public function testShouldGetCurrentUrl()
4545
{

tests/functional/WebDriverActionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public function testShouldClickOnElement()
6161
/**
6262
* @covers ::__construct
6363
* @covers ::clickAndHold
64-
* @covers ::release
6564
* @covers ::perform
65+
* @covers ::release
6666
*/
6767
public function testShouldClickAndHoldOnElementAndRelease()
6868
{

tests/functional/WebDriverAlertTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
use Facebook\WebDriver\Remote\WebDriverBrowserType;
2121

2222
/**
23-
* @covers \Facebook\WebDriver\WebDriverAlert
2423
* @covers \Facebook\WebDriver\Remote\RemoteTargetLocator
24+
* @covers \Facebook\WebDriver\WebDriverAlert
2525
*/
2626
class WebDriverAlertTest extends WebDriverTestCase
2727
{

tests/functional/WebDriverByTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class WebDriverByTest extends WebDriverTestCase
2525
{
2626
/**
27-
* @dataProvider textElementsProvider
27+
* @dataProvider provideTextElements
2828
* @param string $webDriverByLocatorMethod
2929
* @param string $webDriverByLocatorValue
3030
* @param string $expectedText
@@ -52,7 +52,10 @@ public function testShouldFindTextElementByLocator(
5252
}
5353
}
5454

55-
public function textElementsProvider()
55+
/**
56+
* @return array[]
57+
*/
58+
public function provideTextElements()
5659
{
5760
return [
5861
'id' => ['id', 'id_test', 'Test by ID'],

tests/functional/WebDriverCheckboxesTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
use Facebook\WebDriver\Exception\NoSuchElementException;
1919

2020
/**
21-
* @covers \Facebook\WebDriver\WebDriverCheckboxes
2221
* @covers \Facebook\WebDriver\AbstractWebDriverCheckboxOrRadio
22+
* @covers \Facebook\WebDriver\WebDriverCheckboxes
2323
* @group exclude-edge
2424
*/
2525
class WebDriverCheckboxesTest extends WebDriverTestCase
@@ -137,7 +137,7 @@ public function testSelectByIndexInvalid()
137137
}
138138

139139
/**
140-
* @dataProvider selectByVisibleTextDataProvider
140+
* @dataProvider provideSelectByVisibleTextData
141141
*
142142
* @param string $text
143143
* @param string $value
@@ -154,9 +154,9 @@ public function testSelectByVisibleText($text, $value)
154154
}
155155

156156
/**
157-
* @return array
157+
* @return array[]
158158
*/
159-
public function selectByVisibleTextDataProvider()
159+
public function provideSelectByVisibleTextData()
160160
{
161161
return [
162162
['J 2 B', 'j2b'],
@@ -165,7 +165,7 @@ public function selectByVisibleTextDataProvider()
165165
}
166166

167167
/**
168-
* @dataProvider selectByVisiblePartialTextDataProvider
168+
* @dataProvider provideSelectByVisiblePartialTextData
169169
*
170170
* @param string $text
171171
* @param string $value
@@ -182,9 +182,9 @@ public function testSelectByVisiblePartialText($text, $value)
182182
}
183183

184184
/**
185-
* @return array
185+
* @return array[]
186186
*/
187-
public function selectByVisiblePartialTextDataProvider()
187+
public function provideSelectByVisiblePartialTextData()
188188
{
189189
return [
190190
['2 B', 'j2b'],

tests/functional/WebDriverNavigationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
class WebDriverNavigationTest extends WebDriverTestCase
2222
{
2323
/**
24-
* @covers ::to
2524
* @covers ::__construct
25+
* @covers ::to
2626
*/
2727
public function testShouldNavigateToUrl()
2828
{

tests/functional/WebDriverRadiosTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Facebook\WebDriver\Exception\UnsupportedOperationException;
2020

2121
/**
22-
* @covers \Facebook\WebDriver\WebDriverRadios
2322
* @covers \Facebook\WebDriver\AbstractWebDriverCheckboxOrRadio
23+
* @covers \Facebook\WebDriver\WebDriverRadios
2424
* @group exclude-edge
2525
*/
2626
class WebDriverRadiosTest extends WebDriverTestCase
@@ -115,7 +115,7 @@ public function testSelectByIndexInvalid()
115115
}
116116

117117
/**
118-
* @dataProvider selectByVisibleTextDataProvider
118+
* @dataProvider provideSelectByVisibleTextData
119119
*
120120
* @param string $text
121121
* @param string $value
@@ -128,9 +128,9 @@ public function testSelectByVisibleText($text, $value)
128128
}
129129

130130
/**
131-
* @return array
131+
* @return array[]
132132
*/
133-
public function selectByVisibleTextDataProvider()
133+
public function provideSelectByVisibleTextData()
134134
{
135135
return [
136136
['J 3 B', 'j3b'],
@@ -139,7 +139,7 @@ public function selectByVisibleTextDataProvider()
139139
}
140140

141141
/**
142-
* @dataProvider selectByVisiblePartialTextDataProvider
142+
* @dataProvider provideSelectByVisiblePartialTextData
143143
*
144144
* @param string $text
145145
* @param string $value
@@ -152,9 +152,9 @@ public function testSelectByVisiblePartialText($text, $value)
152152
}
153153

154154
/**
155-
* @return array
155+
* @return array[]
156156
*/
157-
public function selectByVisiblePartialTextDataProvider()
157+
public function provideSelectByVisiblePartialTextData()
158158
{
159159
return [
160160
['3 B', 'j3b'],

0 commit comments

Comments
 (0)