Initial commit,修正
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Codeception\Exception;
|
||||
|
||||
use Codeception\Util\Locator;
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
|
||||
use function is_string;
|
||||
|
||||
class ElementNotFound extends AssertionFailedError
|
||||
{
|
||||
public function __construct($selector, string $message = '')
|
||||
{
|
||||
if (!is_string($selector) || !str_contains($selector, "'")) {
|
||||
$selector = Locator::humanReadableString($selector);
|
||||
}
|
||||
parent::__construct("{$message} element with {$selector} was not found.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Codeception\Exception;
|
||||
|
||||
use function ucfirst;
|
||||
|
||||
class MalformedLocatorException extends \RuntimeException
|
||||
{
|
||||
public function __construct(string $locator, string $type = 'CSS or XPath')
|
||||
{
|
||||
parent::__construct(ucfirst($type) . " locator is malformed: {$locator}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user