Skip to content
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: 1 addition & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ public function getCookieJar()
}

/**
* @param string $locator The path to an element to be waited for. Can be a CSS selector or Xpath expression.
* @param int $timeoutInSecond
* @param int $intervalInMillisecond
* @param string $locator The path to an element to be waited for. Can be a CSS selector or Xpath expression.
*
* @throws NoSuchElementException
* @throws TimeoutException
Expand Down
7 changes: 1 addition & 6 deletions src/DomCrawler/Field/FileFormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ protected function initialize()

$type = \strtolower($this->element->getAttribute('type'));
if ('file' !== $type) {
throw new \LogicException(
\sprintf(
'A FileFormField can only be created from an input tag with a type of file (given type is %s).',
$type
)
);
throw new \LogicException(\sprintf('A FileFormField can only be created from an input tag with a type of file (given type is %s).', $type));
}

$value = $this->element->getAttribute('value');
Expand Down
3 changes: 1 addition & 2 deletions src/PantherTestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ protected static function createAdditionalPantherClient(): PantherClient
}

/**
* @param array $options see {@see $defaultOptions}
* @param array $kernelOptions
* @param array $options see {@see $defaultOptions}
*
* @deprecated since Panther 0.7, use createHttpBrowserClient instead
*/
Expand Down
4 changes: 1 addition & 3 deletions src/WebDriver/WebDriverCheckbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ private function byValue($value, $select = true)
}

if (!$matched) {
throw new NoSuchElementException(
\sprintf('Cannot locate option with value: %s', $value)
);
throw new NoSuchElementException(\sprintf('Cannot locate option with value: %s', $value));
}
}

Expand Down
7 changes: 7 additions & 0 deletions tests/fixtures/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
19 changes: 15 additions & 4 deletions tests/fixtures/cookie.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<?php declare(strict_types=1);
<?php

/*
* This file is part of the Panther project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

require __DIR__.'/security-check.php';

$val = $_COOKIE['barcelona'] ?? 0;

\setcookie('barcelona', (string) ($val + 1), 0, '/cookie.php', '127.0.0.1', false, true);

?>

<!DOCTYPE html>
<html lang="en">
<body>
<div id="barcelona"><?=$val; ?></div>
<div id="foo"><?=$_COOKIE['foo'] ?? ''; ?></div>
</body>
</html>

2 changes: 2 additions & 0 deletions tests/fixtures/env.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

declare(strict_types=1);

require __DIR__.'/security-check.php';

if ('APP_ENV' === $_GET['name'] ?? null): ?>
<?=$_ENV['APP_ENV']; ?>
<?php else: ?>
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@

declare(strict_types=1);

require __DIR__.'/security-check.php';

http_response_code(500); // The web server must start even in case of error
echo 'ready';
22 changes: 22 additions & 0 deletions tests/fixtures/security-check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

/*
* This file is part of the Panther project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

if (
isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| '127.0.0.1' !== $_SERVER['REMOTE_ADDR']
|| PHP_SAPI !== 'cli-server'
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check "tests/fixtures/security-check.php" for more information.');
}