first commit

This commit is contained in:
2026-01-25 18:18:09 +08:00
commit 509312e604
8136 changed files with 2349298 additions and 0 deletions

21
vendor/codeception/lib-asserts/LICENSE vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2011 Michael Bodnarchuk and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,35 @@
{
"name":"codeception/lib-asserts",
"description":"Assertion methods used by Codeception core and Asserts module",
"keywords":["codeception"],
"homepage":"https://codeception.com/",
"type":"library",
"license":"MIT",
"authors":[
{
"name":"Michael Bodnarchuk",
"email":"davert@mail.ua",
"homepage":"http://codegyre.com"
},
{
"name":"Gintautas Miselis"
},
{
"name":"Gustavo Nieves",
"homepage": "https://medium.com/@ganieves"
}
],
"minimum-stability": "RC",
"require": {
"php": "^7.4 | ^8.0",
"ext-dom": "*",
"codeception/phpunit-wrapper": "^7.7.1 | ^8.0.3 | ^9.0"
},
"autoload":{
"classmap": ["src/"]
},
"config": {
"classmap-authoritative": true
}
}

View File

@ -0,0 +1,144 @@
# List of supported asserts
## Codeception
```
assertFileNotExists
assertGreaterOrEquals
assertIsEmpty
assertLessOrEquals
assertNotRegExp
assertRegExp
assertThatItsNot
```
## PHPUnit
```
assertArrayHasKey
assertArrayNotHasKey
assertClassHasAttribute
assertClassHasStaticAttribute
assertClassNotHasAttribute
assertClassNotHasStaticAttribute
assertContains
assertContainsEquals
assertContainsOnly
assertContainsOnlyInstancesOf
assertCount
assertDirectoryDoesNotExist
assertDirectoryExists
assertDirectoryIsNotReadable
assertDirectoryIsNotWritable
assertDirectoryIsReadable
assertDirectoryIsWritable
assertDoesNotMatchRegularExpression
assertEmpty
assertEquals
assertEqualsCanonicalizing
assertEqualsIgnoringCase
assertEqualsWithDelta
assertFalse
assertFileDoesNotExist
assertFileEquals
assertFileEqualsCanonicalizing
assertFileEqualsIgnoringCase
assertFileExists
assertFileIsNotReadable
assertFileIsNotWritable
assertFileIsReadable
assertFileIsWritable
assertFileNotEquals
assertFileNotEqualsCanonicalizing
assertFileNotEqualsIgnoringCase
assertFinite
assertGreaterThan
assertGreaterThanOrEqual
assertInfinite
assertInstanceOf
assertIsArray
assertIsBool
assertIsCallable
assertIsClosedResource
assertIsFloat
assertIsInt
assertIsIterable
assertIsNotArray
assertIsNotBool
assertIsNotCallable
assertIsNotClosedResource
assertIsNotFloat
assertIsNotInt
assertIsNotIterable
assertIsNotNumeric
assertIsNotObject
assertIsNotReadable
assertIsNotResource
assertIsNotScalar
assertIsNotString
assertIsNotWritable
assertIsNumeric
assertIsObject
assertIsReadable
assertIsResource
assertIsScalar
assertIsString
assertIsWritable
assertJson
assertJsonFileEqualsJsonFile
assertJsonFileNotEqualsJsonFile
assertJsonStringEqualsJsonFile
assertJsonStringEqualsJsonString
assertJsonStringNotEqualsJsonFile
assertJsonStringNotEqualsJsonString
assertLessThan
assertLessThanOrEqual
assertMatchesRegularExpression
assertNan
assertNotContains
assertNotContainsEquals
assertNotContainsOnly
assertNotCount
assertNotEmpty
assertNotEquals
assertNotEqualsCanonicalizing
assertNotEqualsIgnoringCase
assertNotEqualsWithDelta
assertNotFalse
assertNotInstanceOf
assertNotNull
assertNotSame
assertNotSameSize
assertNotTrue
assertNull
assertObjectHasAttribute
assertObjectNotHasAttribute
assertSame
assertSameSize
assertStringContainsString
assertStringContainsStringIgnoringCase
assertStringEndsNotWith
assertStringEndsWith
assertStringEqualsFile
assertStringEqualsFileCanonicalizing
assertStringEqualsFileIgnoringCase
assertStringMatchesFormat
assertStringMatchesFormatFile
assertStringNotContainsString
assertStringNotContainsStringIgnoringCase
assertStringNotEqualsFile
assertStringNotEqualsFileCanonicalizing
assertStringNotEqualsFileIgnoringCase
assertStringNotMatchesFormat
assertStringNotMatchesFormatFile
assertStringStartsNotWith
assertStringStartsWith
assertThat
assertTrue
assertXmlFileEqualsXmlFile
assertXmlFileNotEqualsXmlFile
assertXmlStringEqualsXmlFile
assertXmlStringEqualsXmlString
assertXmlStringNotEqualsXmlFile
assertXmlStringNotEqualsXmlString
fail
markTestIncomplete
markTestSkipped
```

View File

@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
namespace Codeception\Util\Shared;
use Codeception\PHPUnit\TestCase;
use PHPUnit\Framework\Assert as PHPUnitAssert;
use PHPUnit\Framework\Constraint\Constraint as PHPUnitConstraint;
use PHPUnit\Framework\Constraint\LogicalNot;
trait Asserts
{
use InheritedAsserts;
protected function assert(array $arguments, bool $not = false)
{
$not = $not ? 'Not' : '';
$method = ucfirst(array_shift($arguments));
if (($method === 'True') && $not) {
$method = 'False';
$not = '';
}
if (($method === 'False') && $not) {
$method = 'True';
$not = '';
}
call_user_func_array([PHPUnitAssert::class, 'assert' . $not . $method], $arguments);
}
protected function assertNot($arguments)
{
$this->assert($arguments, true);
}
/**
* Asserts that a file does not exist.
*/
protected function assertFileNotExists(string $filename, string $message = '')
{
TestCase::assertFileDoesNotExist($filename, $message);
}
/**
* Asserts that a value is greater than or equal to another value.
*
* @param mixed $expected
* @param mixed $actual
*/
protected function assertGreaterOrEquals($expected, $actual, string $message = '')
{
TestCase::assertGreaterThanOrEqual($expected, $actual, $message);
}
/**
* Asserts that a variable is empty.
*
* @param mixed $actual
*/
protected function assertIsEmpty($actual, string $message = '')
{
TestCase::assertEmpty($actual, $message);
}
/**
* Asserts that a value is smaller than or equal to another value.
*
* @param mixed $expected
* @param mixed $actual
*/
protected function assertLessOrEquals($expected, $actual, string $message = '')
{
TestCase::assertLessThanOrEqual($expected, $actual, $message);
}
/**
* Asserts that a string does not match a given regular expression.
*/
protected function assertNotRegExp(string $pattern, string $string, string $message = '')
{
TestCase::assertDoesNotMatchRegularExpression($pattern, $string, $message);
}
/**
* Asserts that a string matches a given regular expression.
*/
protected function assertRegExp(string $pattern, string $string, string $message = '')
{
TestCase::assertMatchesRegularExpression($pattern, $string, $message);
}
/**
* Evaluates a PHPUnit\Framework\Constraint matcher object.
*
* @param mixed $value
*/
protected function assertThatItsNot($value, PHPUnitConstraint $constraint, string $message = '')
{
$constraint = new LogicalNot($constraint);
TestCase::assertThat($value, $constraint, $message);
}
}

File diff suppressed because it is too large Load Diff