Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to static data-providers #63

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Basic/BasicAuthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class BasicAuthTest extends TestCase
final class BasicAuthTest extends TestCase
{
/**
* @dataProvider setBasicAuthDataProvider
Expand All @@ -20,7 +20,7 @@ public function testSetBasicAuth($user, $pass, $pageText)
$this->assertStringContainsString($pageText, $session->getPage()->getContent());
}

public function setBasicAuthDataProvider()
public static function setBasicAuthDataProvider()
{
return array(
array('mink-user', 'mink-password', 'is authenticated'),
Expand Down
4 changes: 2 additions & 2 deletions tests/Basic/BestPracticesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* This testcase ensures that the driver implementation follows recommended practices for drivers.
*/
class BestPracticesTest extends TestCase
final class BestPracticesTest extends TestCase
{
public function testExtendsCoreDriver()
{
Expand Down Expand Up @@ -40,7 +40,7 @@ public function testImplementBasicApi($method)
$this->assertImplementMethod($method, $driver, 'The driver is unusable when this method is not implemented.');
}

public function provideRequiredMethods()
public static function provideRequiredMethods()
{
return array(
array('start'),
Expand Down
4 changes: 2 additions & 2 deletions tests/Basic/ContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class ContentTest extends TestCase
final class ContentTest extends TestCase
{
public function testOuterHtml()
{
Expand Down Expand Up @@ -46,7 +46,7 @@ public function testGetAttribute($attributeName, $attributeValue)
$this->assertSame($attributeValue, $element->getAttribute($attributeName));
}

public function getAttributeDataProvider()
public static function getAttributeDataProvider()
{
return array(
array('with-value', 'some-value'),
Expand Down
12 changes: 2 additions & 10 deletions tests/Basic/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class CookieTest extends TestCase
final class CookieTest extends TestCase
{
/**
* test cookie decoding.
Expand Down Expand Up @@ -87,7 +87,7 @@ public function testCookieWithPaths($cookieRemovalMode)
$this->assertStringContainsString('Previous cookie: NO', $session->getPage()->getText());
}

public function cookieWithPathsDataProvider()
public static function cookieWithPathsDataProvider()
{
return array(
array('session_reset'),
Expand Down Expand Up @@ -123,14 +123,6 @@ public function testCookieInSubPath($cookieRemovalMode)
$this->assertStringContainsString('Previous cookie: NO', $session->getPage()->getText());
}

public function cookieInSubPathProvider()
{
return array(
array('session_reset'),
array('cookie_delete'),
);
}

public function testReset()
{
$this->getSession()->visit($this->pathTo('/cookie_page1.php'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/ErrorHandlingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @group slow
*/
class ErrorHandlingTest extends TestCase
final class ErrorHandlingTest extends TestCase
{
const NOT_FOUND_XPATH = '//html/./invalid';

Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/HeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class HeaderTest extends TestCase
final class HeaderTest extends TestCase
{
/**
* test referrer.
Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/IFrameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class IFrameTest extends TestCase
final class IFrameTest extends TestCase
{
public function testIFrame()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/NavigationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Behat\Mink\Tests\Driver\TestCase;
use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames;

class NavigationTest extends TestCase
final class NavigationTest extends TestCase
{
use AssertionRenames;

Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/ScreenshotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class ScreenshotTest extends TestCase
final class ScreenshotTest extends TestCase
{
public function testScreenshot()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/StatusCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class StatusCodeTest extends TestCase
final class StatusCodeTest extends TestCase
{
public function testStatuses()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/TraversingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Behat\Mink\Tests\Driver\TestCase;
use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames;

class TraversingTest extends TestCase
final class TraversingTest extends TestCase
{
use AssertionRenames;

Expand Down
2 changes: 1 addition & 1 deletion tests/Basic/VisibilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class VisibilityTest extends TestCase
final class VisibilityTest extends TestCase
{
public function testVisibility()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Css/HoverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class HoverTest extends TestCase
final class HoverTest extends TestCase
{
/**
* @group mouse-events
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/CheckboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class CheckboxTest extends TestCase
final class CheckboxTest extends TestCase
{
public function testManipulate()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Form/GeneralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class GeneralTest extends TestCase
final class GeneralTest extends TestCase
{
// test multiple submit buttons
public function testIssue212()
Expand Down Expand Up @@ -76,7 +76,7 @@ public function testFormSubmitWays($submitVia)
}
}

public function formSubmitWaysDataProvider()
public static function formSubmitWaysDataProvider()
{
return array(
array('Save'),
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Html5Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class Html5Test extends TestCase
final class Html5Test extends TestCase
{
public function testHtml5FormInputAttribute()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/RadioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class RadioTest extends TestCase
final class RadioTest extends TestCase
{
/**
* @before
Expand Down
4 changes: 2 additions & 2 deletions tests/Form/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class SelectTest extends TestCase
final class SelectTest extends TestCase
{
public function testMultiselect()
{
Expand Down Expand Up @@ -77,7 +77,7 @@ public function testElementSelectedStateCheck($selectName, $optionValue, $option
$this->assertTrue($option->isSelected());
}

public function elementSelectedStateCheckDataProvider()
public static function elementSelectedStateCheckDataProvider()
{
return array(
array('select_number', '30', 'thirty'),
Expand Down
8 changes: 4 additions & 4 deletions tests/Js/ChangeEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @group slow
*/
class ChangeEventTest extends TestCase
final class ChangeEventTest extends TestCase
{
/**
* 'change' event should be fired after selecting an <option> in a <select>.
Expand Down Expand Up @@ -58,7 +58,7 @@ public function testSetValueChangeEvent($elementId, $valueForEmpty, $valueForFil
}
}

public function setValueChangeEventDataProvider()
public static function setValueChangeEventDataProvider()
{
$file1 = __DIR__ . '/../../web-fixtures/file1.txt';
$file2 = __DIR__ . '/../../web-fixtures/file2.txt';
Expand Down Expand Up @@ -90,7 +90,7 @@ public function testSelectOptionChangeEvent($elementId, $elementValue)
$this->assertElementChangeCount($elementId);
}

public function selectOptionChangeEventDataProvider()
public static function selectOptionChangeEventDataProvider()
{
return array(
'select' => array('the-select', '30'),
Expand Down Expand Up @@ -140,7 +140,7 @@ public function testUncheckChangeEvent($useSetValue)
$this->assertElementChangeCount('the-checked-checkbox');
}

public function checkboxTestWayDataProvider()
public static function checkboxTestWayDataProvider()
{
return array(
array(true),
Expand Down
4 changes: 2 additions & 2 deletions tests/Js/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class EventsTest extends TestCase
final class EventsTest extends TestCase
{
/**
* @group mouse-events
Expand Down Expand Up @@ -114,7 +114,7 @@ public function testKeyboardEvents($modifier, $eventProperties)
$this->assertEquals('key upped:78 / '.$eventProperties, $event->getText());
}

public function provideKeyboardEventsModifiers()
public static function provideKeyboardEventsModifiers()
{
return array(
'none' => array(null, '0 / 0 / 0 / 0'),
Expand Down
6 changes: 3 additions & 3 deletions tests/Js/JavascriptEvaluationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class JavascriptEvaluationTest extends TestCase
final class JavascriptEvaluationTest extends TestCase
{
/**
* Tests, that `wait` method returns check result after exit.
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testExecuteScript($script)
$this->assertEquals('Hello world', $heading->getText());
}

public function provideExecutedScript()
public static function provideExecutedScript()
{
return array(
array('document.querySelector("h1").textContent = "Hello world"'),
Expand All @@ -77,7 +77,7 @@ public function testEvaluateJavascript($script)
$this->assertSame(2, $this->getSession()->evaluateScript($script));
}

public function provideEvaluatedScript()
public static function provideEvaluatedScript()
{
return array(
array('1 + 1'),
Expand Down
2 changes: 1 addition & 1 deletion tests/Js/JavascriptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class JavascriptTest extends TestCase
final class JavascriptTest extends TestCase
{
public function testAriaRoles()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Js/WindowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Behat\Mink\Tests\Driver\TestCase;

class WindowTest extends TestCase
final class WindowTest extends TestCase
{
public function testWindow()
{
Expand Down