Initial commit

This commit is contained in:
ftc
2025-09-25 23:03:07 +03:00
commit fe417d9941
6627 changed files with 2153223 additions and 0 deletions
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace Codeception\Constraint;
use PHPUnit\Framework\ExpectationFailedException;
use SebastianBergmann\Comparator\ComparisonFailure;
use Symfony\Component\DomCrawler\Crawler as SymfonyCrawler;
class CrawlerNot extends Crawler
{
/**
* @param SymfonyCrawler $nodes
* @return bool
*/
protected function matches($nodes): bool
{
return !parent::matches($nodes);
}
/**
* @param SymfonyCrawler $nodes
* @param string $selector
* @param ComparisonFailure|null $comparisonFailure
*/
protected function fail($nodes, $selector, ?ComparisonFailure $comparisonFailure = null): never
{
if (!$this->string) {
throw new ExpectationFailedException(
"Element '{$selector}' was found",
$comparisonFailure
);
}
$output = "There was '{$selector}' element ";
$output .= $this->uriMessage('on page');
$output .= $this->nodesList($nodes, $this->string);
$output .= "\ncontaining '{$this->string}'";
throw new ExpectationFailedException(
$output,
$comparisonFailure
);
}
public function toString(): string
{
if ($this->string) {
return 'that contains text "' . $this->string . '"';
}
return '';
}
}