class IntegrationTestCase
Integration test helper.
@author Fabien Potencier <fabien@symfony.com> @author Karma Dordrak <drak@zikula.org>
Hierarchy
- class \PHPUnit\Framework\Assert
- class \PHPUnit\Framework\TestCase extends \PHPUnit\Framework\Assert implements \PHPUnit\Framework\Reorderable, \PHPUnit\Framework\SelfDescribing, \PHPUnit\Framework\Test
- class \Twig\Test\IntegrationTestCase extends \PHPUnit\Framework\TestCase
- class \PHPUnit\Framework\TestCase extends \PHPUnit\Framework\Assert implements \PHPUnit\Framework\Reorderable, \PHPUnit\Framework\SelfDescribing, \PHPUnit\Framework\Test
Expanded class hierarchy of IntegrationTestCase
File
-
vendor/
twig/ twig/ src/ Test/ IntegrationTestCase.php, line 30
Namespace
Twig\TestView source
abstract class IntegrationTestCase extends TestCase {
/**
* @deprecated since Twig 3.13, use getFixturesDirectory() instead.
*
* @return string
*/
protected function getFixturesDir() {
throw new \BadMethodCallException('Not implemented.');
}
protected static function getFixturesDirectory() : string {
throw new \BadMethodCallException('Not implemented.');
}
/**
* @return RuntimeLoaderInterface[]
*/
protected function getRuntimeLoaders() {
return [];
}
/**
* @return ExtensionInterface[]
*/
protected function getExtensions() {
return [];
}
/**
* @return TwigFilter[]
*/
protected function getTwigFilters() {
return [];
}
/**
* @return TwigFunction[]
*/
protected function getTwigFunctions() {
return [];
}
/**
* @return TwigTest[]
*/
protected function getTwigTests() {
return [];
}
/**
* @dataProvider getTests
*/
public function testIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') {
$this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation);
}
/**
* @dataProvider getLegacyTests
*
* @group legacy
*/
public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') {
$this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation);
}
/**
* @final since Twig 3.13
*/
public function getTests($name, $legacyTests = false) {
try {
$fixturesDir = static::getFixturesDirectory();
} catch (\BadMethodCallException) {
trigger_deprecation('twig/twig', '3.13', 'Not overriding "%s::getFixturesDirectory()" in "%s" is deprecated. This method will be abstract in 4.0.', self::class, static::class);
$fixturesDir = $this->getFixturesDir();
}
$fixturesDir = realpath($fixturesDir);
$tests = [];
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($fixturesDir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
if (!preg_match('/\\.test$/', $file)) {
continue;
}
if ($legacyTests xor str_contains($file->getRealpath(), '.legacy.test')) {
continue;
}
$test = file_get_contents($file->getRealpath());
if (preg_match('/--TEST--\\s*(.*?)\\s*(?:--CONDITION--\\s*(.*))?\\s*(?:--DEPRECATION--\\s*(.*?))?\\s*((?:--TEMPLATE(?:\\(.*?\\))?--(?:.*?))+)\\s*(?:--DATA--\\s*(.*))?\\s*--EXCEPTION--\\s*(.*)/sx', $test, $match)) {
$message = $match[1];
$condition = $match[2];
$deprecation = $match[3];
$templates = self::parseTemplates($match[4]);
$exception = $match[6];
$outputs = [
[
null,
$match[5],
null,
'',
],
];
}
elseif (preg_match('/--TEST--\\s*(.*?)\\s*(?:--CONDITION--\\s*(.*))?\\s*(?:--DEPRECATION--\\s*(.*?))?\\s*((?:--TEMPLATE(?:\\(.*?\\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) {
$message = $match[1];
$condition = $match[2];
$deprecation = $match[3];
$templates = self::parseTemplates($match[4]);
$exception = false;
preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\\-\\-DATA\\-\\-|$)/s', $test, $outputs, \PREG_SET_ORDER);
}
else {
throw new \InvalidArgumentException(\sprintf('Test "%s" is not valid.', str_replace($fixturesDir . '/', '', $file)));
}
$tests[str_replace($fixturesDir . '/', '', $file)] = [
str_replace($fixturesDir . '/', '', $file),
$message,
$condition,
$templates,
$exception,
$outputs,
$deprecation,
];
}
if ($legacyTests && !$tests) {
// add a dummy test to avoid a PHPUnit message
return [
[
'not',
'-',
'',
[],
'',
[],
],
];
}
return $tests;
}
/**
* @final since Twig 3.13
*/
public function getLegacyTests() {
return $this->getTests('testLegacyIntegration', true);
}
protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation = '') {
if (!$outputs) {
$this->markTestSkipped('no tests to run');
}
if ($condition) {
$ret = '';
eval('$ret = ' . $condition . ';');
if (!$ret) {
$this->markTestSkipped($condition);
}
}
foreach ($outputs as $i => $match) {
$config = array_merge([
'cache' => false,
'strict_variables' => true,
], $match[2] ? eval($match[2] . ';') : []);
// make sure that template are always compiled even if they are the same (useful when testing with more than one data/expect sections)
foreach ($templates as $j => $template) {
$templates[$j] = $template . str_repeat(' ', $i);
}
$loader = new ArrayLoader($templates);
$twig = new Environment($loader, $config);
$twig->addGlobal('global', 'global');
foreach ($this->getRuntimeLoaders() as $runtimeLoader) {
$twig->addRuntimeLoader($runtimeLoader);
}
foreach ($this->getExtensions() as $extension) {
$twig->addExtension($extension);
}
foreach ($this->getTwigFilters() as $filter) {
$twig->addFilter($filter);
}
foreach ($this->getTwigTests() as $test) {
$twig->addTest($test);
}
foreach ($this->getTwigFunctions() as $function) {
$twig->addFunction($function);
}
$deprecations = [];
try {
$prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) {
if (\E_USER_DEPRECATED === $type) {
$deprecations[] = $msg;
return true;
}
return $prevHandler ? $prevHandler($type, $msg, $file, $line, $context) : false;
});
$template = $twig->load('index.twig');
} catch (\Exception $e) {
if (false !== $exception) {
$message = $e->getMessage();
$this->assertSame(trim($exception), trim(\sprintf('%s: %s', \get_class($e), $message)));
$last = substr($message, \strlen($message) - 1);
$this->assertTrue('.' === $last || '?' === $last, 'Exception message must end with a dot or a question mark.');
return;
}
throw new Error(\sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e);
} finally {
restore_error_handler();
}
$this->assertSame($deprecation, implode("\n", $deprecations));
try {
$output = trim($template->render(eval($match[1] . ';')), "\n ");
} catch (\Exception $e) {
if (false !== $exception) {
$this->assertStringMatchesFormat(trim($exception), trim(\sprintf('%s: %s', \get_class($e), $e->getMessage())));
return;
}
$e = new Error(\sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e);
$output = trim(\sprintf('%s: %s', \get_class($e), $e->getMessage()));
}
if (false !== $exception) {
[
$class,
] = explode(':', $exception);
$constraintClass = class_exists('PHPUnit\\Framework\\Constraint\\Exception') ? 'PHPUnit\\Framework\\Constraint\\Exception' : 'PHPUnit_Framework_Constraint_Exception';
$this->assertThat(null, new $constraintClass($class));
}
$expected = trim($match[3], "\n ");
if ($expected !== $output) {
printf("Compiled templates that failed on case %d:\n", $i + 1);
foreach (array_keys($templates) as $name) {
echo "Template: {$name}\n";
echo $twig->compile($twig->parse($twig->tokenize($twig->getLoader()
->getSourceContext($name))));
}
}
$this->assertEquals($expected, $output, $message . ' (in ' . $file . ')');
}
}
protected static function parseTemplates($test) {
$templates = [];
preg_match_all('/--TEMPLATE(?:\\((.*?)\\))?--(.*?)(?=\\-\\-TEMPLATE|$)/s', $test, $matches, \PREG_SET_ORDER);
foreach ($matches as $match) {
$templates[$match[1] ?: 'index.twig'] = $match[2];
}
return $templates;
}
}
Members
Title Sort descending | Deprecated | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|---|
Assert::$count | private static | property | ||||
Assert::anything | final public static | function | ||||
Assert::arrayHasKey | final public static | function | ||||
Assert::assertArrayHasKey | final public static | function | Asserts that an array has a specified key. | |||
Assert::assertArrayNotHasKey | final public static | function | Asserts that an array does not have a specified key. | |||
Assert::assertContains | final public static | function | Asserts that a haystack contains a needle. | |||
Assert::assertContainsEquals | final public static | function | ||||
Assert::assertContainsOnly | final public static | function | Asserts that a haystack contains only values of a given type. | |||
Assert::assertContainsOnlyInstancesOf | final public static | function | Asserts that a haystack contains only instances of a given class name. | |||
Assert::assertCount | final public static | function | Asserts the number of elements of an array, Countable or Traversable. | |||
Assert::assertDirectoryDoesNotExist | final public static | function | Asserts that a directory does not exist. | |||
Assert::assertDirectoryExists | final public static | function | Asserts that a directory exists. | |||
Assert::assertDirectoryIsNotReadable | final public static | function | Asserts that a directory exists and is not readable. | |||
Assert::assertDirectoryIsNotWritable | final public static | function | Asserts that a directory exists and is not writable. | |||
Assert::assertDirectoryIsReadable | final public static | function | Asserts that a directory exists and is readable. | |||
Assert::assertDirectoryIsWritable | final public static | function | Asserts that a directory exists and is writable. | |||
Assert::assertDoesNotMatchRegularExpression | final public static | function | Asserts that a string does not match a given regular expression. | |||
Assert::assertEmpty | final public static | function | Asserts that a variable is empty. | |||
Assert::assertEquals | final public static | function | Asserts that two variables are equal. | |||
Assert::assertEqualsCanonicalizing | final public static | function | Asserts that two variables are equal (canonicalizing). | |||
Assert::assertEqualsIgnoringCase | final public static | function | Asserts that two variables are equal (ignoring case). | |||
Assert::assertEqualsWithDelta | final public static | function | Asserts that two variables are equal (with delta). | |||
Assert::assertFalse | final public static | function | Asserts that a condition is false. | |||
Assert::assertFileDoesNotExist | final public static | function | Asserts that a file does not exist. | |||
Assert::assertFileEquals | final public static | function | Asserts that the contents of one file is equal to the contents of another file. |
|||
Assert::assertFileEqualsCanonicalizing | final public static | function | Asserts that the contents of one file is equal to the contents of another file (canonicalizing). |
|||
Assert::assertFileEqualsIgnoringCase | final public static | function | Asserts that the contents of one file is equal to the contents of another file (ignoring case). |
|||
Assert::assertFileExists | final public static | function | Asserts that a file exists. | |||
Assert::assertFileIsNotReadable | final public static | function | Asserts that a file exists and is not readable. | |||
Assert::assertFileIsNotWritable | final public static | function | Asserts that a file exists and is not writable. | |||
Assert::assertFileIsReadable | final public static | function | Asserts that a file exists and is readable. | |||
Assert::assertFileIsWritable | final public static | function | Asserts that a file exists and is writable. | |||
Assert::assertFileMatchesFormat | final public static | function | Asserts that a string matches a given format string. | |||
Assert::assertFileMatchesFormatFile | final public static | function | Asserts that a string matches a given format string. | |||
Assert::assertFileNotEquals | final public static | function | Asserts that the contents of one file is not equal to the contents of another file. |
|||
Assert::assertFileNotEqualsCanonicalizing | final public static | function | Asserts that the contents of one file is not equal to the contents of another file (canonicalizing). |
|||
Assert::assertFileNotEqualsIgnoringCase | final public static | function | Asserts that the contents of one file is not equal to the contents of another file (ignoring case). |
|||
Assert::assertFinite | final public static | function | Asserts that a variable is finite. | |||
Assert::assertGreaterThan | final public static | function | Asserts that a value is greater than another value. | |||
Assert::assertGreaterThanOrEqual | final public static | function | Asserts that a value is greater than or equal to another value. | |||
Assert::assertInfinite | final public static | function | Asserts that a variable is infinite. | |||
Assert::assertInstanceOf | final public static | function | Asserts that a variable is of a given type. | |||
Assert::assertIsArray | final public static | function | Asserts that a variable is of type array. | |||
Assert::assertIsBool | final public static | function | Asserts that a variable is of type bool. | |||
Assert::assertIsCallable | final public static | function | Asserts that a variable is of type callable. | |||
Assert::assertIsClosedResource | final public static | function | Asserts that a variable is of type resource and is closed. | |||
Assert::assertIsFloat | final public static | function | Asserts that a variable is of type float. | |||
Assert::assertIsInt | final public static | function | Asserts that a variable is of type int. | |||
Assert::assertIsIterable | final public static | function | Asserts that a variable is of type iterable. | |||
Assert::assertIsList | final public static | function | ||||
Assert::assertIsNotArray | final public static | function | Asserts that a variable is not of type array. | |||
Assert::assertIsNotBool | final public static | function | Asserts that a variable is not of type bool. | |||
Assert::assertIsNotCallable | final public static | function | Asserts that a variable is not of type callable. | |||
Assert::assertIsNotClosedResource | final public static | function | Asserts that a variable is not of type resource. | |||
Assert::assertIsNotFloat | final public static | function | Asserts that a variable is not of type float. | |||
Assert::assertIsNotInt | final public static | function | Asserts that a variable is not of type int. | |||
Assert::assertIsNotIterable | final public static | function | Asserts that a variable is not of type iterable. | |||
Assert::assertIsNotNumeric | final public static | function | Asserts that a variable is not of type numeric. | |||
Assert::assertIsNotObject | final public static | function | Asserts that a variable is not of type object. | |||
Assert::assertIsNotReadable | final public static | function | Asserts that a file/dir exists and is not readable. | |||
Assert::assertIsNotResource | final public static | function | Asserts that a variable is not of type resource. | |||
Assert::assertIsNotScalar | final public static | function | Asserts that a variable is not of type scalar. | |||
Assert::assertIsNotString | final public static | function | Asserts that a variable is not of type string. | |||
Assert::assertIsNotWritable | final public static | function | Asserts that a file/dir exists and is not writable. | |||
Assert::assertIsNumeric | final public static | function | Asserts that a variable is of type numeric. | |||
Assert::assertIsObject | final public static | function | Asserts that a variable is of type object. | |||
Assert::assertIsReadable | final public static | function | Asserts that a file/dir is readable. | |||
Assert::assertIsResource | final public static | function | Asserts that a variable is of type resource. | |||
Assert::assertIsScalar | final public static | function | Asserts that a variable is of type scalar. | |||
Assert::assertIsString | final public static | function | Asserts that a variable is of type string. | |||
Assert::assertIsWritable | final public static | function | Asserts that a file/dir exists and is writable. | |||
Assert::assertJson | final public static | function | Asserts that a string is a valid JSON string. | |||
Assert::assertJsonFileEqualsJsonFile | final public static | function | Asserts that two JSON files are equal. | |||
Assert::assertJsonFileNotEqualsJsonFile | final public static | function | Asserts that two JSON files are not equal. | |||
Assert::assertJsonStringEqualsJsonFile | final public static | function | Asserts that the generated JSON encoded object and the content of the given file are equal. | |||
Assert::assertJsonStringEqualsJsonString | final public static | function | Asserts that two given JSON encoded objects or arrays are equal. | |||
Assert::assertJsonStringNotEqualsJsonFile | final public static | function | Asserts that the generated JSON encoded object and the content of the given file are not equal. | |||
Assert::assertJsonStringNotEqualsJsonString | final public static | function | Asserts that two given JSON encoded objects or arrays are not equal. | |||
Assert::assertLessThan | final public static | function | Asserts that a value is smaller than another value. | |||
Assert::assertLessThanOrEqual | final public static | function | Asserts that a value is smaller than or equal to another value. | |||
Assert::assertMatchesRegularExpression | final public static | function | Asserts that a string matches a given regular expression. | |||
Assert::assertNan | final public static | function | Asserts that a variable is nan. | |||
Assert::assertNotContains | final public static | function | Asserts that a haystack does not contain a needle. | |||
Assert::assertNotContainsEquals | final public static | function | ||||
Assert::assertNotContainsOnly | final public static | function | Asserts that a haystack does not contain only values of a given type. | |||
Assert::assertNotCount | final public static | function | Asserts the number of elements of an array, Countable or Traversable. | |||
Assert::assertNotEmpty | final public static | function | Asserts that a variable is not empty. | |||
Assert::assertNotEquals | final public static | function | Asserts that two variables are not equal. | |||
Assert::assertNotEqualsCanonicalizing | final public static | function | Asserts that two variables are not equal (canonicalizing). | |||
Assert::assertNotEqualsIgnoringCase | final public static | function | Asserts that two variables are not equal (ignoring case). | |||
Assert::assertNotEqualsWithDelta | final public static | function | Asserts that two variables are not equal (with delta). | |||
Assert::assertNotFalse | final public static | function | Asserts that a condition is not false. | |||
Assert::assertNotInstanceOf | final public static | function | Asserts that a variable is not of a given type. | |||
Assert::assertNotNull | final public static | function | Asserts that a variable is not null. | |||
Assert::assertNotSame | final public static | function | Asserts that two variables do not have the same type and value. Used on objects, it asserts that two variables do not reference the same object. |
|||
Assert::assertNotSameSize | final public static | function | Assert that the size of two arrays (or `Countable` or `Traversable` objects) is not the same. |
|||
Assert::assertNotTrue | final public static | function | Asserts that a condition is not true. | |||
Assert::assertNull | final public static | function | Asserts that a variable is null. | |||
Assert::assertObjectEquals | final public static | function | ||||
Assert::assertObjectHasProperty | final public static | function | Asserts that an object has a specified property. | |||
Assert::assertObjectNotHasProperty | final public static | function | Asserts that an object does not have a specified property. | |||
Assert::assertSame | final public static | function | Asserts that two variables have the same type and value. Used on objects, it asserts that two variables reference the same object. |
|||
Assert::assertSameSize | final public static | function | Assert that the size of two arrays (or `Countable` or `Traversable` objects) is the same. |
|||
Assert::assertStringContainsString | final public static | function | ||||
Assert::assertStringContainsStringIgnoringCase | final public static | function | ||||
Assert::assertStringContainsStringIgnoringLineEndings | final public static | function | ||||
Assert::assertStringEndsNotWith | final public static | function | Asserts that a string ends not with a given suffix. | |||
Assert::assertStringEndsWith | final public static | function | Asserts that a string ends with a given suffix. | |||
Assert::assertStringEqualsFile | final public static | function | Asserts that the contents of a string is equal to the contents of a file. |
|||
Assert::assertStringEqualsFileCanonicalizing | final public static | function | Asserts that the contents of a string is equal to the contents of a file (canonicalizing). |
|||
Assert::assertStringEqualsFileIgnoringCase | final public static | function | Asserts that the contents of a string is equal to the contents of a file (ignoring case). |
|||
Assert::assertStringEqualsStringIgnoringLineEndings | final public static | function | Asserts that two strings are equal except for line endings. | |||
Assert::assertStringMatchesFormat | final public static | function | Asserts that a string matches a given format string. | |||
Assert::assertStringMatchesFormatFile | final public static | function | Asserts that a string matches a given format file. | |||
Assert::assertStringNotContainsString | final public static | function | ||||
Assert::assertStringNotContainsStringIgnoringCase | final public static | function | ||||
Assert::assertStringNotEqualsFile | final public static | function | Asserts that the contents of a string is not equal to the contents of a file. |
|||
Assert::assertStringNotEqualsFileCanonicalizing | final public static | function | Asserts that the contents of a string is not equal to the contents of a file (canonicalizing). |
|||
Assert::assertStringNotEqualsFileIgnoringCase | final public static | function | Asserts that the contents of a string is not equal to the contents of a file (ignoring case). |
|||
Assert::assertStringNotMatchesFormat | Deprecated | final public static | function | Asserts that a string does not match a given format string. | ||
Assert::assertStringNotMatchesFormatFile | Deprecated | final public static | function | Asserts that a string does not match a given format string. | ||
Assert::assertStringStartsNotWith | final public static | function | Asserts that a string starts not with a given prefix. | |||
Assert::assertStringStartsWith | final public static | function | Asserts that a string starts with a given prefix. | |||
Assert::assertThat | final public static | function | Evaluates a PHPUnit\Framework\Constraint matcher object. | |||
Assert::assertTrue | final public static | function | Asserts that a condition is true. | |||
Assert::assertXmlFileEqualsXmlFile | final public static | function | Asserts that two XML files are equal. | |||
Assert::assertXmlFileNotEqualsXmlFile | final public static | function | Asserts that two XML files are not equal. | |||
Assert::assertXmlStringEqualsXmlFile | final public static | function | Asserts that two XML documents are equal. | |||
Assert::assertXmlStringEqualsXmlString | final public static | function | Asserts that two XML documents are equal. | |||
Assert::assertXmlStringNotEqualsXmlFile | final public static | function | Asserts that two XML documents are not equal. | |||
Assert::assertXmlStringNotEqualsXmlString | final public static | function | Asserts that two XML documents are not equal. | |||
Assert::callback | final public static | function | @psalm-template CallbackInput of mixed | |||
Assert::containsEqual | final public static | function | ||||
Assert::containsIdentical | final public static | function | ||||
Assert::containsOnly | final public static | function | ||||
Assert::containsOnlyInstancesOf | final public static | function | ||||
Assert::countOf | final public static | function | ||||
Assert::directoryExists | final public static | function | ||||
Assert::equalTo | final public static | function | ||||
Assert::equalToCanonicalizing | final public static | function | ||||
Assert::equalToIgnoringCase | final public static | function | ||||
Assert::equalToWithDelta | final public static | function | ||||
Assert::fail | final public static | function | Fails a test with the given message. | |||
Assert::fileExists | final public static | function | ||||
Assert::getCount | final public static | function | Return the current assertion count. | |||
Assert::greaterThan | final public static | function | ||||
Assert::greaterThanOrEqual | final public static | function | ||||
Assert::identicalTo | final public static | function | ||||
Assert::isEmpty | final public static | function | ||||
Assert::isFalse | final public static | function | ||||
Assert::isFinite | final public static | function | ||||
Assert::isInfinite | final public static | function | ||||
Assert::isInstanceOf | final public static | function | ||||
Assert::isJson | final public static | function | ||||
Assert::isList | final public static | function | ||||
Assert::isNan | final public static | function | ||||
Assert::isNativeType | private static | function | ||||
Assert::isNull | final public static | function | ||||
Assert::isReadable | final public static | function | ||||
Assert::isTrue | final public static | function | ||||
Assert::isType | final public static | function | @psalm-param 'array'|'boolean'|'bool'|'double'|'float'|'integer'|'int'|'null'|'numeric'|'object'|'real'|'resource'|'resource… | |||
Assert::isWritable | final public static | function | ||||
Assert::lessThan | final public static | function | ||||
Assert::lessThanOrEqual | final public static | function | ||||
Assert::logicalAnd | final public static | function | ||||
Assert::logicalNot | final public static | function | ||||
Assert::logicalOr | final public static | function | ||||
Assert::logicalXor | final public static | function | ||||
Assert::markTestIncomplete | final public static | function | Mark the test as incomplete. | |||
Assert::markTestSkipped | final public static | function | Mark the test as skipped. | |||
Assert::matches | final public static | function | ||||
Assert::matchesRegularExpression | final public static | function | ||||
Assert::objectEquals | final public static | function | ||||
Assert::resetCount | final public static | function | Reset the assertion counter. | |||
Assert::stringContains | final public static | function | ||||
Assert::stringEndsWith | final public static | function | @psalm-param non-empty-string $suffix | |||
Assert::stringEqualsStringIgnoringLineEndings | final public static | function | ||||
Assert::stringStartsWith | final public static | function | @psalm-param non-empty-string $prefix | |||
IntegrationTestCase::doIntegrationTest | protected | function | ||||
IntegrationTestCase::getExtensions | protected | function | ||||
IntegrationTestCase::getFixturesDir | Deprecated | protected | function | |||
IntegrationTestCase::getFixturesDirectory | protected static | function | ||||
IntegrationTestCase::getLegacyTests | public | function | @final since Twig 3.13 | |||
IntegrationTestCase::getRuntimeLoaders | protected | function | ||||
IntegrationTestCase::getTests | public | function | @final since Twig 3.13 | |||
IntegrationTestCase::getTwigFilters | protected | function | ||||
IntegrationTestCase::getTwigFunctions | protected | function | ||||
IntegrationTestCase::getTwigTests | protected | function | ||||
IntegrationTestCase::parseTemplates | protected static | function | ||||
IntegrationTestCase::testIntegration | public | function | @dataProvider getTests | |||
IntegrationTestCase::testLegacyIntegration | public | function | @dataProvider getLegacyTests | |||
TestCase::$backupGlobals | private | property | ||||
TestCase::$backupGlobalsExcludeList | private | property | @psalm-var list<string> | |||
TestCase::$backupStaticProperties | private | property | ||||
TestCase::$backupStaticPropertiesExcludeList | private | property | @psalm-var array<string,list<class-string>> | |||
TestCase::$customComparators | private | property | @psalm-var list<Comparator> | |||
TestCase::$data | private | property | ||||
TestCase::$dataName | private | property | ||||
TestCase::$dependencies | private | property | @psalm-var list<ExecutionOrderDependency> | |||
TestCase::$dependencyInput | private | property | ||||
TestCase::$doesNotPerformAssertions | private | property | ||||
TestCase::$expectedException | private | property | ||||
TestCase::$expectedExceptionCode | private | property | ||||
TestCase::$expectedExceptionMessage | private | property | ||||
TestCase::$expectedExceptionMessageRegExp | private | property | ||||
TestCase::$failureTypes | private | property | @psalm-var array<class-string, true> | |||
TestCase::$groups | private | property | @psalm-var list<string> | |||
TestCase::$iniSettings | private | property | @psalm-var array<string,string> | |||
TestCase::$inIsolation | private | property | ||||
TestCase::$locale | private | property | ||||
TestCase::$mockObjects | private | property | @psalm-var list<MockObjectInternal> | |||
TestCase::$name | private | property | @psalm-var non-empty-string | |||
TestCase::$numberOfAssertionsPerformed | private | property | ||||
TestCase::$output | private | property | ||||
TestCase::$outputBufferingActive | private | property | ||||
TestCase::$outputBufferingLevel | private | property | ||||
TestCase::$outputExpectedRegex | private | property | ||||
TestCase::$outputExpectedString | private | property | ||||
TestCase::$outputRetrievedForAssertion | private | property | ||||
TestCase::$preserveGlobalState | private | property | ||||
TestCase::$providedTests | private | property | @psalm-var list<ExecutionOrderDependency> | |||
TestCase::$registerMockObjectsFromTestArgumentsRecursively | private | property | ||||
TestCase::$runClassInSeparateProcess | private | property | ||||
TestCase::$runTestInSeparateProcess | private | property | ||||
TestCase::$snapshot | private | property | ||||
TestCase::$status | private | property | ||||
TestCase::$testResult | private | property | ||||
TestCase::$testValueObjectForEvents | private | property | ||||
TestCase::$wasPrepared | private | property | ||||
TestCase::addToAssertionCount | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::any | final public static | function | Returns a matcher that matches when the method is executed zero or more times. |
|||
TestCase::assertPostConditions | protected | function | Performs assertions shared by all tests of a test case. | |||
TestCase::assertPreConditions | protected | function | Performs assertions shared by all tests of a test case. | |||
TestCase::atLeast | final public static | function | Returns a matcher that matches when the method is executed at least N times. |
|||
TestCase::atLeastOnce | final public static | function | Returns a matcher that matches when the method is executed at least once. | |||
TestCase::atMost | final public static | function | Returns a matcher that matches when the method is executed at most N times. |
|||
TestCase::checkRequirements | private | function | ||||
TestCase::cleanupIniSettings | private | function | ||||
TestCase::cleanupLocaleSettings | private | function | ||||
TestCase::compareGlobalStateSnapshotPart | private | function | ||||
TestCase::compareGlobalStateSnapshots | private | function | ||||
TestCase::count | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::createConfiguredMock | protected | function | Creates (and configures) a mock object for the specified interface or class. | |||
TestCase::createConfiguredStub | final protected static | function | Creates (and configures) a test stub for the specified interface or class. | |||
TestCase::createGlobalStateSnapshot | private | function | ||||
TestCase::createMock | protected | function | Creates a mock object for the specified interface or class. | |||
TestCase::createMockForIntersectionOfInterfaces | protected | function | @psalm-param list<class-string> $interfaces | |||
TestCase::createPartialMock | protected | function | Creates a partial mock object for the specified interface or class. | |||
TestCase::createStub | protected static | function | Creates a test stub for the specified interface or class. | |||
TestCase::createStubForIntersectionOfInterfaces | protected static | function | @psalm-param list<class-string> $interfaces | |||
TestCase::createTestProxy | Deprecated | protected | function | Creates a test proxy for the specified class. | ||
TestCase::dataName | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::dataSetAsString | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::dataSetAsStringWithData | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::dependencyInput | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::doesNotPerformAssertions | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::exactly | final public static | function | Returns a matcher that matches when the method is executed exactly $count times. |
|||
TestCase::expectedExceptionWasNotRaised | private | function | ||||
TestCase::expectException | final public | function | @psalm-param class-string<Throwable> $exception | |||
TestCase::expectExceptionCode | final public | function | ||||
TestCase::expectExceptionMessage | final public | function | ||||
TestCase::expectExceptionMessageMatches | final public | function | ||||
TestCase::expectExceptionObject | final public | function | Sets up an expectation for an exception to be raised by the code under test. Information for expected exception class, expected exception message, and expected exception code are retrieved from a given Exception object. |
|||
TestCase::expectNotToPerformAssertions | final public | function | ||||
TestCase::expectOutputRegex | final public | function | ||||
TestCase::expectOutputString | final public | function | ||||
TestCase::expectsOutput | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::getActualOutputForAssertion | final public | function | ||||
TestCase::getMockBuilder | final public | function | Returns a builder object to create mock objects using a fluent interface. | |||
TestCase::getMockForAbstractClass | Deprecated | protected | function | Creates a mock object for the specified abstract class with all abstract methods of the class mocked. Concrete methods are not mocked by default. To mock concrete methods, use the 7th parameter ($mockedMethods). |
||
TestCase::getMockForTrait | Deprecated | protected | function | Creates a mock object for the specified trait with all abstract methods of the trait mocked. Concrete methods to mock can be specified with the `$mockedMethods` parameter. |
||
TestCase::getMockFromWsdl | Deprecated | protected | function | Creates a mock object based on the given WSDL file. | ||
TestCase::getObjectForTrait | Deprecated | protected | function | Creates an object that uses the specified trait. | ||
TestCase::groups | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::handleDependencies | private | function | ||||
TestCase::hasDependencyInput | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::hasExpectationOnOutput | private | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::hasUnexpectedOutput | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::iniSet | Deprecated | protected | function | This method is a wrapper for the ini_set() function that automatically resets the modified php.ini setting to its original value after the test is run. |
||
TestCase::invokeAfterClassHookMethods | private | function | @codeCoverageIgnore | |||
TestCase::invokeAfterTestHookMethods | private | function | ||||
TestCase::invokeBeforeClassHookMethods | private | function | @codeCoverageIgnore | |||
TestCase::invokeBeforeTestHookMethods | private | function | ||||
TestCase::invokeHookMethods | private | function | @psalm-param list<non-empty-string> $hookMethods @psalm-param… |
|||
TestCase::invokePostConditionHookMethods | private | function | ||||
TestCase::invokePreConditionHookMethods | private | function | ||||
TestCase::isCallableTestMethod | private | function | ||||
TestCase::isRegisteredFailure | private | function | ||||
TestCase::LOCALE_CATEGORIES | private | constant | ||||
TestCase::markErrorForInvalidDependency | private | function | ||||
TestCase::markSkippedForMissingDependency | private | function | ||||
TestCase::methodDoesNotExistOrIsDeclaredInTestCase | private | function | ||||
TestCase::name | final public | function | @psalm-return non-empty-string | |||
TestCase::nameWithDataSet | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::never | final public static | function | Returns a matcher that matches when the method is never executed. | |||
TestCase::numberOfAssertionsPerformed | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::once | final public static | function | Returns a matcher that matches when the method is executed exactly once. | |||
TestCase::onConsecutiveCalls | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::onNotSuccessfulTest | protected | function | This method is called when a test method did not execute successfully. | |||
TestCase::output | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::performAssertionsOnOutput | private | function | ||||
TestCase::providedData | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::provides | final public | function | @psalm-return list<ExecutionOrderDependency> | Overrides Reorderable::provides | ||
TestCase::registerComparator | final protected | function | ||||
TestCase::registerFailureType | final protected | function | @psalm-param class-string $classOrInterface | |||
TestCase::registerMockObject | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::registerMockObjectsFromTestArguments | private | function | ||||
TestCase::registerMockObjectsFromTestArgumentsRecursively | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::requirementsNotSatisfied | private | function | ||||
TestCase::requires | final public | function | @psalm-return list<ExecutionOrderDependency> | Overrides Reorderable::requires | ||
TestCase::restoreGlobalState | private | function | ||||
TestCase::result | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::returnArgument | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::returnCallback | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::returnSelf | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::returnValue | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::returnValueMap | Deprecated | final public static | function | @codeCoverageIgnore | ||
TestCase::run | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | Overrides Test::run | ||
TestCase::runBare | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::runTest | protected | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setBackupGlobals | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setBackupGlobalsExcludeList | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setBackupStaticProperties | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setBackupStaticPropertiesExcludeList | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setData | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setDependencies | final public | function | @psalm-param list<ExecutionOrderDependency> $dependencies | |||
TestCase::setDependencyInput | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setGroups | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setInIsolation | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setLocale | Deprecated | protected | function | This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run. |
||
TestCase::setName | final public | function | @psalm-param non-empty-string $name | |||
TestCase::setPreserveGlobalState | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setResult | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setRunClassInSeparateProcess | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setRunTestInSeparateProcess | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::setUp | protected | function | This method is called before each test. | 3 | ||
TestCase::setUpBeforeClass | public static | function | This method is called before the first test of this test class is run. | |||
TestCase::shouldExceptionExpectationsBeVerified | private | function | ||||
TestCase::shouldInvocationMockerBeReset | private | function | ||||
TestCase::shouldRunInSeparateProcess | private | function | ||||
TestCase::size | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::snapshotGlobalState | private | function | ||||
TestCase::sortId | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | Overrides Reorderable::sortId | ||
TestCase::startOutputBuffering | private | function | ||||
TestCase::status | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::stopOutputBuffering | private | function | ||||
TestCase::tearDown | protected | function | This method is called after each test. | 2 | ||
TestCase::tearDownAfterClass | public static | function | This method is called after the last test of this test class is run. | |||
TestCase::throwException | final public static | function | ||||
TestCase::toString | public | function | Returns a string representation of the test case. | Overrides SelfDescribing::toString | ||
TestCase::transformException | protected | function | ||||
TestCase::unregisterCustomComparators | private | function | ||||
TestCase::usesDataProvider | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::valueObjectForEvents | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::verifyExceptionExpectations | private | function | ||||
TestCase::verifyMockObjects | private | function | ||||
TestCase::wasPrepared | final public | function | @internal This method is not covered by the backward compatibility promise for PHPUnit | |||
TestCase::__construct | public | function | @psalm-param non-empty-string $name |