đã tạo được test case của createUser

This commit is contained in:
2026-04-07 11:22:54 +07:00
parent 9d0a872e91
commit 8a7ffe6212
235 changed files with 30524 additions and 9502 deletions
@@ -0,0 +1,16 @@
<?php declare(strict_types=1);
namespace Facebook\WebDriver\Exception\Internal;
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
/**
* The driver server process is unexpectedly no longer available.
*/
class DriverServerDiedException extends \RuntimeException implements PhpWebDriverExceptionInterface
{
public function __construct(?\Exception $previous = null)
{
parent::__construct('The driver server has died.', 0, $previous);
}
}
@@ -0,0 +1,16 @@
<?php declare(strict_types=1);
namespace Facebook\WebDriver\Exception\Internal;
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
/**
* Exception class thrown when a filesystem related operation failure happens.
*/
class IOException extends \LogicException implements PhpWebDriverExceptionInterface
{
public static function forFileError(string $message, string $path): self
{
return new self(sprintf($message . ' ("%s")', $path));
}
}
@@ -0,0 +1,29 @@
<?php declare(strict_types=1);
namespace Facebook\WebDriver\Exception\Internal;
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
/**
* Exception thrown when error in program logic occurs. This includes invalid domain data and unexpected data states.
*/
class LogicException extends \LogicException implements PhpWebDriverExceptionInterface
{
public static function forError(string $message): self
{
return new self($message);
}
public static function forInvalidHttpMethod(string $url, string $httpMethod, array $params): self
{
return new self(
sprintf(
'The http method called for "%s" is "%s", but it has to be POST' .
' if you want to pass the JSON params %s',
$url,
$httpMethod,
json_encode($params)
)
);
}
}
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);
namespace Facebook\WebDriver\Exception\Internal;
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
use Symfony\Component\Process\Process;
/**
* Exception thrown if an error which can only be found on runtime occurs.
*/
class RuntimeException extends \RuntimeException implements PhpWebDriverExceptionInterface
{
public static function forError(string $message): self
{
return new self($message);
}
public static function forDriverError(Process $process): self
{
return new self(
sprintf(
'Error starting driver executable "%s": %s',
$process->getCommandLine(),
$process->getErrorOutput()
)
);
}
}
@@ -0,0 +1,51 @@
<?php declare(strict_types=1);
namespace Facebook\WebDriver\Exception\Internal;
use Facebook\WebDriver\Exception\PhpWebDriverExceptionInterface;
/**
* Exception thrown on invalid or unexpected server response.
*/
class UnexpectedResponseException extends \RuntimeException implements PhpWebDriverExceptionInterface
{
public static function forError(string $message): self
{
return new self($message);
}
public static function forElementNotArray($response): self
{
return new self(
sprintf(
"Unexpected server response for getting an element. Expected array, but the response was: '%s'\n",
print_r($response, true)
)
);
}
public static function forJsonDecodingError(int $jsonLastError, string $rawResults): self
{
return new self(
sprintf(
"JSON decoding of remote response failed.\n" .
"Error code: %d\n" .
"The response: '%s'\n",
$jsonLastError,
$rawResults
)
);
}
public static function forCapabilitiesRetrievalError(\Exception $previousException): self
{
return new self(
sprintf(
'Existing Capabilities were not provided, and they also cannot be read from Selenium Grid'
. ' (error: "%s"). You are probably not using Selenium Grid, so to reuse the previous session,'
. ' Capabilities must be explicitly provided to createBySessionID() method.',
$previousException->getMessage()
)
);
}
}
@@ -0,0 +1,22 @@
<?php
namespace Facebook\WebDriver\Exception\Internal;
/**
* @deprecated To be replaced with UnexpectedResponseException in 2.0
*/
class WebDriverCurlException extends UnexpectedResponseException
{
public static function forCurlError(string $httpMethod, string $url, string $curlError, ?array $params): self
{
$message = sprintf('Curl error thrown for http %s to %s', $httpMethod, $url);
if (!empty($params)) {
$message .= sprintf(' with params: %s', json_encode($params, JSON_UNESCAPED_SLASHES));
}
$message .= "\n\n" . $curlError;
return new self($message);
}
}