Lggr
|
Inherits PHPUnit\Framework\Assert, PHPUnit\Framework\Test, and PHPUnit\Framework\SelfDescribing.
Inherited by AbstractTest, AdminConfigTest, AssertionExampleTest, BankAccountTest, BankAccountWithCustomExtensionTest, BeforeAndAfterTest, BeforeClassAndAfterClassTest, BeforeClassWithOnlyDataProviderTest, ChangeCurrentWorkingDirectoryTest, ClonedDependencyTest, ConfigTest, ConsecutiveParametersTest, CoverageClassExtendedTest, CoverageClassTest, CoverageFunctionParenthesesTest, CoverageFunctionParenthesesWhitespaceTest, CoverageFunctionTest, CoverageMethodOneLineAnnotationTest, CoverageMethodParenthesesTest, CoverageMethodParenthesesWhitespaceTest, CoverageMethodTest, CoverageNamespacedFunctionTest, CoverageNoneTest, CoverageNothingTest, CoverageNotPrivateTest, CoverageNotProtectedTest, CoverageNotPublicTest, CoveragePrivateTest, CoverageProtectedTest, CoveragePublicTest, DataProviderDebugTest, DataProviderDependencyTest, DataProviderFilterTest, DataProviderIncompleteTest, DataProviderSkippedTest, DataProviderTest, DataProviderTestDoxTest, DependencyFailureTest, DependencySuccessTest, DummyBarTest, DummyFooTest, EmptyTestCaseTest, ExceptionInAssertPostConditionsTest, ExceptionInAssertPreConditionsTest, ExceptionInSetUpTest, ExceptionInTearDownTest, ExceptionInTest, ExceptionStackTest, ExceptionTest, Failure, FailureTest, FatalTest, Foo\DataProviderIssue2833\FirstTest, Foo\DataProviderIssue2833\SecondTest, Foo\DataProviderIssue2859\TestWithDataProviderTest, Foo\DataProviderIssue2922\FirstTest, Foo\DataProviderIssue2922\SecondHelloWorldTest, Foo_Bar_Issue684Test, Framework\Constraint\LogicalXorTest, GeneratorTest, GenericDbTestCase, IgnoreCodeCoverageClassTest, IncompleteTest, InheritanceB, IniTest, InvocationMockerTest, IsolationTest, Issue1021Test, Issue1149Test, Issue1216Test, Issue1265Test, Issue1330Test, Issue1335Test, Issue1337Test, Issue1348Test, Issue1351Test, Issue1374Test, Issue1437Test, Issue1468Test, Issue1471Test, Issue1472Test, Issue1570Test, Issue2137Test, Issue2145Test, Issue2158Test, Issue2366Test, Issue2380Test, Issue2382Test, Issue2435Test, Issue244Test, Issue2591_SeparateClassPreserveTest, Issue2591_SeparateFunctionNoPreserveTest, Issue2591_SeparateFunctionPreserveTest, Issue2725\BeforeAfterClassPidTest, Issue2731Test, Issue2811Test, Issue2830Test, Issue2972\Issue2972Test, Issue322Test, Issue433Test, Issue445Test, Issue498Test, Issue503Test, Issue523Test, Issue578Test, Issue581Test, Issue74Test, Issue765Test, Issue797Test, MockBuilderTest, MockObjectTest, MultiDependencyTest, MultipleDataProviderTest, My\Space\ExceptionNamespaceTest, NamespaceCoverageClassExtendedTest, NamespaceCoverageClassTest, NamespaceCoverageCoversClassPublicTest, NamespaceCoverageCoversClassTest, NamespaceCoverageMethodTest, NamespaceCoverageNotPrivateTest, NamespaceCoverageNotProtectedTest, NamespaceCoverageNotPublicTest, NamespaceCoveragePrivateTest, NamespaceCoverageProtectedTest, NamespaceCoveragePublicTest, NoArgTestCaseTest, NoTestCases, NotExistingCoveredElementTest, NothingTest, NotPublicTestCase, NotVoidTestCase, ObjectInvocationTest, OneTest, OneTestCase, OutputTestCase, PharIo\Manifest\ApplicationNameTest, PharIo\Manifest\ApplicationTest, PharIo\Manifest\AuthorCollectionTest, PharIo\Manifest\AuthorTest, PharIo\Manifest\BundledComponentCollectionTest, PharIo\Manifest\BundledComponentTest, PharIo\Manifest\CopyrightInformationTest, PharIo\Manifest\EmailTest, PharIo\Manifest\ExtensionTest, PharIo\Manifest\LibraryTest, PharIo\Manifest\LicenseTest, PharIo\Manifest\ManifestTest, PharIo\Manifest\PhpExtensionRequirementTest, PharIo\Manifest\PhpVersionRequirementTest, PharIo\Manifest\RequirementCollectionTest, PharIo\Manifest\UrlTest, PharIo\Version\AbstractVersionConstraintTest, PharIo\Version\AndVersionConstraintGroupTest, PharIo\Version\AnyVersionConstraintTest, PharIo\Version\ExactVersionConstraintTest, PharIo\Version\GreaterThanOrEqualToVersionConstraintTest, PharIo\Version\OrVersionConstraintGroupTest, PharIo\Version\SpecificMajorAndMinorVersionConstraintTest, PharIo\Version\SpecificMajorVersionConstraintTest, PharIo\Version\VersionConstraintParserTest, PharIo\Version\VersionTest, PHP_TimerTest, PHP_Token_ClassTest, PHP_Token_ClosureTest, PHP_Token_FunctionTest, PHP_Token_IncludeTest, PHP_Token_InterfaceTest, PHP_Token_NamespaceTest, PHP_TokenTest, PHPUnit\Framework\AssertTest, PHPUnit\Framework\BaseTestListenerTest, PHPUnit\Framework\Constraint\ConstraintTestCase, PHPUnit\Framework\Constraint\ExceptionMessageRegExpTest, PHPUnit\Framework\Constraint\ExceptionMessageTest, PHPUnit\Framework\Constraint\JsonMatchesErrorMessageProviderTest, PHPUnit\Framework\ConstraintTest, PHPUnit\Framework\IncompleteTestCase, PHPUnit\Framework\SkippedTestCase, PHPUnit\Framework\SuiteTest, PHPUnit\Framework\TestCaseTest, PHPUnit\Framework\TestFailureTest, PHPUnit\Framework\TestImplementorTest, PHPUnit\Framework\TestListenerTest, PHPUnit\Framework\WarningTestCase, PHPUnit\Runner\Filter\NameFilterIteratorTest, PHPUnit\Runner\PhptTestCaseTest, PHPUnit\TextUI\TestRunnerTest, PHPUnit\Util\ConfigurationGeneratorTest, PHPUnit\Util\ConfigurationTest, PHPUnit\Util\GetoptTest, PHPUnit\Util\GlobalStateTest, PHPUnit\Util\JsonTest, PHPUnit\Util\PHP\AbstractPhpProcessTest, PHPUnit\Util\RegularExpressionTest, PHPUnit\Util\TestDox\NamePrettifierTest, PHPUnit\Util\TestTest, PHPUnit\Util\XmlTest, ProxyObjectTest, RequirementsClassBeforeClassHookTest, RequirementsTest, SebastianBergmann\CodeCoverage\TestCase, SebastianBergmann\CodeUnitReverseLookup\WizardTest, SebastianBergmann\Comparator\ArrayComparatorTest, SebastianBergmann\Comparator\ComparisonFailureTest, SebastianBergmann\Comparator\DateTimeComparatorTest, SebastianBergmann\Comparator\DOMNodeComparatorTest, SebastianBergmann\Comparator\DoubleComparatorTest, SebastianBergmann\Comparator\ExceptionComparatorTest, SebastianBergmann\Comparator\FactoryTest, SebastianBergmann\Comparator\MockObjectComparatorTest, SebastianBergmann\Comparator\NumericComparatorTest, SebastianBergmann\Comparator\ObjectComparatorTest, SebastianBergmann\Comparator\ResourceComparatorTest, SebastianBergmann\Comparator\ScalarComparatorTest, SebastianBergmann\Comparator\SplObjectStorageComparatorTest, SebastianBergmann\Comparator\TypeComparatorTest, SebastianBergmann\Diff\ChunkTest, SebastianBergmann\Diff\DifferTestTest, SebastianBergmann\Diff\DiffTest, SebastianBergmann\Diff\LineTest, SebastianBergmann\Diff\LongestCommonSubsequenceTest, SebastianBergmann\Diff\ParserTest, SebastianBergmann\Environment\ConsoleTest, SebastianBergmann\Environment\OperatingSystemTest, SebastianBergmann\Environment\RuntimeTest, SebastianBergmann\Exporter\ExporterTest, SebastianBergmann\GlobalState\BlacklistTest, SebastianBergmann\GlobalState\CodeExporterTest, SebastianBergmann\GlobalState\RestorerTest, SebastianBergmann\GlobalState\SnapshotTest, SebastianBergmann\ObjectEnumerator\EnumeratorTest, SebastianBergmann\ObjectReflector\ObjectReflectorTest, SebastianBergmann\RecursionContext\ContextTest, StackTest, StaticInvocationTest, StopsOnWarningTest, Success, TemplateMethodsTest, TestAutoreferenced, TestDoxGroupTest, TestError, TestIncomplete, TestSkipped, TestWithTest, ThrowExceptionTestCase, ThrowNoExceptionTestCase, TwoTest, vendor\project\StatusTest, and WasRun.
Static Public Member Functions | |
static | any () |
static | never () |
static | atLeast ($requiredInvocations) |
static | atLeastOnce () |
static | once () |
static | exactly ($count) |
static | atMost ($allowedInvocations) |
static | at ($index) |
static | returnValue ($value) |
static | returnValueMap (array $valueMap) |
static | returnArgument ($argumentIndex) |
static | returnCallback ($callback) |
static | returnSelf () |
static | throwException (Throwable $exception) |
static | onConsecutiveCalls () |
static | setUpBeforeClass () |
static | tearDownAfterClass () |
![]() | |
static | assertArrayHasKey ($key, $array, $message='') |
static | assertArraySubset ($subset, $array, $strict=false, $message='') |
static | assertArrayNotHasKey ($key, $array, $message='') |
static | assertContains ($needle, $haystack, $message='', $ignoreCase=false, $checkForObjectIdentity=true, $checkForNonObjectIdentity=false) |
static | assertAttributeContains ($needle, $haystackAttributeName, $haystackClassOrObject, $message='', $ignoreCase=false, $checkForObjectIdentity=true, $checkForNonObjectIdentity=false) |
static | assertNotContains ($needle, $haystack, $message='', $ignoreCase=false, $checkForObjectIdentity=true, $checkForNonObjectIdentity=false) |
static | assertAttributeNotContains ($needle, $haystackAttributeName, $haystackClassOrObject, $message='', $ignoreCase=false, $checkForObjectIdentity=true, $checkForNonObjectIdentity=false) |
static | assertContainsOnly ($type, $haystack, $isNativeType=null, $message='') |
static | assertContainsOnlyInstancesOf ($classname, $haystack, $message='') |
static | assertAttributeContainsOnly ($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType=null, $message='') |
static | assertNotContainsOnly ($type, $haystack, $isNativeType=null, $message='') |
static | assertAttributeNotContainsOnly ($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType=null, $message='') |
static | assertCount ($expectedCount, $haystack, $message='') |
static | assertAttributeCount ($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message='') |
static | assertNotCount ($expectedCount, $haystack, $message='') |
static | assertAttributeNotCount ($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message='') |
static | assertEquals ($expected, $actual, $message='', $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | assertAttributeEquals ($expected, $actualAttributeName, $actualClassOrObject, $message='', $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | assertNotEquals ($expected, $actual, $message='', $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | assertAttributeNotEquals ($expected, $actualAttributeName, $actualClassOrObject, $message='', $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | assertEmpty ($actual, $message='') |
static | assertAttributeEmpty ($haystackAttributeName, $haystackClassOrObject, $message='') |
static | assertNotEmpty ($actual, $message='') |
static | assertAttributeNotEmpty ($haystackAttributeName, $haystackClassOrObject, $message='') |
static | assertGreaterThan ($expected, $actual, $message='') |
static | assertAttributeGreaterThan ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertGreaterThanOrEqual ($expected, $actual, $message='') |
static | assertAttributeGreaterThanOrEqual ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertLessThan ($expected, $actual, $message='') |
static | assertAttributeLessThan ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertLessThanOrEqual ($expected, $actual, $message='') |
static | assertAttributeLessThanOrEqual ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertFileEquals ($expected, $actual, $message='', $canonicalize=false, $ignoreCase=false) |
static | assertFileNotEquals ($expected, $actual, $message='', $canonicalize=false, $ignoreCase=false) |
static | assertStringEqualsFile ($expectedFile, $actualString, $message='', $canonicalize=false, $ignoreCase=false) |
static | assertStringNotEqualsFile ($expectedFile, $actualString, $message='', $canonicalize=false, $ignoreCase=false) |
static | assertIsReadable ($filename, $message='') |
static | assertNotIsReadable ($filename, $message='') |
static | assertIsWritable ($filename, $message='') |
static | assertNotIsWritable ($filename, $message='') |
static | assertDirectoryExists ($directory, $message='') |
static | assertDirectoryNotExists ($directory, $message='') |
static | assertDirectoryIsReadable ($directory, $message='') |
static | assertDirectoryNotIsReadable ($directory, $message='') |
static | assertDirectoryIsWritable ($directory, $message='') |
static | assertDirectoryNotIsWritable ($directory, $message='') |
static | assertFileExists ($filename, $message='') |
static | assertFileNotExists ($filename, $message='') |
static | assertFileIsReadable ($file, $message='') |
static | assertFileNotIsReadable ($file, $message='') |
static | assertFileIsWritable ($file, $message='') |
static | assertFileNotIsWritable ($file, $message='') |
static | assertTrue ($condition, $message='') |
static | assertNotTrue ($condition, $message='') |
static | assertFalse ($condition, $message='') |
static | assertNotFalse ($condition, $message='') |
static | assertNull ($actual, $message='') |
static | assertNotNull ($actual, $message='') |
static | assertFinite ($actual, $message='') |
static | assertInfinite ($actual, $message='') |
static | assertNan ($actual, $message='') |
static | assertClassHasAttribute ($attributeName, $className, $message='') |
static | assertClassNotHasAttribute ($attributeName, $className, $message='') |
static | assertClassHasStaticAttribute ($attributeName, $className, $message='') |
static | assertClassNotHasStaticAttribute ($attributeName, $className, $message='') |
static | assertObjectHasAttribute ($attributeName, $object, $message='') |
static | assertObjectNotHasAttribute ($attributeName, $object, $message='') |
static | assertSame ($expected, $actual, $message='') |
static | assertAttributeSame ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertNotSame ($expected, $actual, $message='') |
static | assertAttributeNotSame ($expected, $actualAttributeName, $actualClassOrObject, $message='') |
static | assertInstanceOf ($expected, $actual, $message='') |
static | assertAttributeInstanceOf ($expected, $attributeName, $classOrObject, $message='') |
static | assertNotInstanceOf ($expected, $actual, $message='') |
static | assertAttributeNotInstanceOf ($expected, $attributeName, $classOrObject, $message='') |
static | assertInternalType ($expected, $actual, $message='') |
static | assertAttributeInternalType ($expected, $attributeName, $classOrObject, $message='') |
static | assertNotInternalType ($expected, $actual, $message='') |
static | assertAttributeNotInternalType ($expected, $attributeName, $classOrObject, $message='') |
static | assertRegExp ($pattern, $string, $message='') |
static | assertNotRegExp ($pattern, $string, $message='') |
static | assertSameSize ($expected, $actual, $message='') |
static | assertNotSameSize ($expected, $actual, $message='') |
static | assertStringMatchesFormat ($format, $string, $message='') |
static | assertStringNotMatchesFormat ($format, $string, $message='') |
static | assertStringMatchesFormatFile ($formatFile, $string, $message='') |
static | assertStringNotMatchesFormatFile ($formatFile, $string, $message='') |
static | assertStringStartsWith ($prefix, $string, $message='') |
static | assertStringStartsNotWith ($prefix, $string, $message='') |
static | assertStringEndsWith ($suffix, $string, $message='') |
static | assertStringEndsNotWith ($suffix, $string, $message='') |
static | assertXmlFileEqualsXmlFile ($expectedFile, $actualFile, $message='') |
static | assertXmlFileNotEqualsXmlFile ($expectedFile, $actualFile, $message='') |
static | assertXmlStringEqualsXmlFile ($expectedFile, $actualXml, $message='') |
static | assertXmlStringNotEqualsXmlFile ($expectedFile, $actualXml, $message='') |
static | assertXmlStringEqualsXmlString ($expectedXml, $actualXml, $message='') |
static | assertXmlStringNotEqualsXmlString ($expectedXml, $actualXml, $message='') |
static | assertEqualXMLStructure (DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes=false, $message='') |
static | assertThat ($value, Constraint $constraint, $message='') |
static | assertJson ($actualJson, $message='') |
static | assertJsonStringEqualsJsonString ($expectedJson, $actualJson, $message='') |
static | assertJsonStringNotEqualsJsonString ($expectedJson, $actualJson, $message='') |
static | assertJsonStringEqualsJsonFile ($expectedFile, $actualJson, $message='') |
static | assertJsonStringNotEqualsJsonFile ($expectedFile, $actualJson, $message='') |
static | assertJsonFileEqualsJsonFile ($expectedFile, $actualFile, $message='') |
static | assertJsonFileNotEqualsJsonFile ($expectedFile, $actualFile, $message='') |
static | logicalAnd () |
static | logicalOr () |
static | logicalNot (Constraint $constraint) |
static | logicalXor () |
static | anything () |
static | isTrue () |
static | callback ($callback) |
static | isFalse () |
static | isJson () |
static | isNull () |
static | isFinite () |
static | isInfinite () |
static | isNan () |
static | attribute (Constraint $constraint, $attributeName) |
static | contains ($value, $checkForObjectIdentity=true, $checkForNonObjectIdentity=false) |
static | containsOnly ($type) |
static | containsOnlyInstancesOf ($classname) |
static | arrayHasKey ($key) |
static | equalTo ($value, $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | attributeEqualTo ($attributeName, $value, $delta=0.0, $maxDepth=10, $canonicalize=false, $ignoreCase=false) |
static | isEmpty () |
static | isWritable () |
static | isReadable () |
static | directoryExists () |
static | fileExists () |
static | greaterThan ($value) |
static | greaterThanOrEqual ($value) |
static | classHasAttribute ($attributeName) |
static | classHasStaticAttribute ($attributeName) |
static | objectHasAttribute ($attributeName) |
static | identicalTo ($value) |
static | isInstanceOf ($className) |
static | isType ($type) |
static | lessThan ($value) |
static | lessThanOrEqual ($value) |
static | matchesRegularExpression ($pattern) |
static | matches ($string) |
static | stringStartsWith ($prefix) |
static | stringContains ($string, $case=true) |
static | stringEndsWith ($suffix) |
static | countOf ($count) |
static | fail ($message='') |
static | readAttribute ($classOrObject, $attributeName) |
static | getStaticAttribute ($className, $attributeName) |
static | getObjectAttribute ($object, $attributeName) |
static | markTestIncomplete ($message='') |
static | markTestSkipped ($message='') |
static | getCount () |
static | resetCount () |
Protected Member Functions | |
setExpectedExceptionFromAnnotation () | |
setUseErrorHandlerFromAnnotation () | |
checkRequirements () | |
runTest () | |
verifyMockObjects () | |
iniSet ($varName, $newValue) | |
setLocale () | |
createMock ($originalClassName) | |
createConfiguredMock ($originalClassName, array $configuration) | |
createPartialMock ($originalClassName, array $methods) | |
createTestProxy ($originalClassName, array $constructorArguments=[]) | |
getMockClass ($originalClassName, $methods=[], array $arguments=[], $mockClassName='', $callOriginalConstructor=false, $callOriginalClone=true, $callAutoload=true, $cloneArguments=false) | |
getMockForAbstractClass ($originalClassName, array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[], $cloneArguments=false) | |
getMockFromWsdl ($wsdlFile, $originalClassName='', $mockClassName='', array $methods=[], $callOriginalConstructor=true, array $options=[]) | |
getMockForTrait ($traitName, array $arguments=[], $mockClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true, $mockedMethods=[], $cloneArguments=false) | |
getObjectForTrait ($traitName, array $arguments=[], $traitClassName='', $callOriginalConstructor=true, $callOriginalClone=true, $callAutoload=true) | |
prophesize ($classOrInterface=null) | |
getProvidedData () | |
createResult () | |
handleDependencies () | |
setUp () | |
assertPreConditions () | |
assertPostConditions () | |
tearDown () | |
onNotSuccessfulTest (Throwable $t) | |
prepareTemplate (Text_Template $template) | |
Protected Attributes | |
$backupGlobals | |
$backupGlobalsBlacklist = [] | |
$backupStaticAttributes | |
$backupStaticAttributesBlacklist = [] | |
$runTestInSeparateProcess | |
$preserveGlobalState = true | |
A TestCase defines the fixture to run multiple tests.
To define a TestCase
1) Implement a subclass of PHPUnit\Framework\TestCase. 2) Define instance variables that store the state of the fixture. 3) Initialize the fixture state by overriding setUp(). 4) Clean-up after a test by overriding tearDown().
Each test runs in its own fixture so there can be no side effects among test runs.
Here is an example:
<?php class MathTest extends PHPUnit\Framework\TestCase { public $value1; public $value2;
protected function setUp() { $this->value1 = 2; $this->value2 = 3; } } ?>
For each test implement a method which interacts with the fixture. Verify the expected results with assertions specified by calling assert with a boolean.
<?php public function testPass() { $this->assertTrue($this->value1 + $this->value2 == 5); } ?>
PHPUnit\Framework\TestCase::__construct | ( | $name = null , |
|
array | $data = [] , |
||
$dataName = '' |
|||
) |
Constructs a test case with the given name.
string | $name | |
array | $data | |
string | $dataName |
PHPUnit\Framework\TestCase::addToAssertionCount | ( | $count | ) |
Adds a value to the assertion counter.
int | $count |
|
static |
Returns a matcher that matches when the method is executed zero or more times.
|
protected |
Performs assertions shared by all tests of a test case.
This method is called after the execution of a test ends and before tearDown() is called.
Reimplemented in TemplateMethodsTest, ExceptionInAssertPreConditionsTest, ExceptionInSetUpTest, ExceptionInTest, ExceptionInAssertPostConditionsTest, and ExceptionInTearDownTest.
|
protected |
Performs assertions shared by all tests of a test case.
This method is called before the execution of a test starts and after setUp() is called.
Reimplemented in ExceptionInSetUpTest, ExceptionInAssertPostConditionsTest, ExceptionInAssertPreConditionsTest, ExceptionInTearDownTest, ExceptionInTest, and TemplateMethodsTest.
|
static |
Returns a matcher that matches when the method is executed at the given index.
int | $index |
|
static |
Returns a matcher that matches when the method is executed at least N times.
int | $requiredInvocations |
|
static |
Returns a matcher that matches when the method is executed at least once.
|
static |
Returns a matcher that matches when the method is executed at most N times.
int | $allowedInvocations |
PHPUnit\Framework\TestCase::count | ( | ) |
Counts the number of test cases executed by run(TestResult result).
|
protected |
Returns a configured test double for the specified class.
string | $originalClassName | |
array | $configuration |
Exception |
|
protected |
Returns a test double for the specified class.
string | $originalClassName |
Exception |
|
protected |
Returns a partial test double for the specified class.
string | $originalClassName | |
string[] | $methods |
Exception |
|
protected |
Creates a default TestResult object.
|
protected |
Returns a test proxy for the specified class.
string | $originalClassName | |
array | $constructorArguments |
Exception |
PHPUnit\Framework\TestCase::dataDescription | ( | ) |
PHPUnit\Framework\TestCase::dataName | ( | ) |
PHPUnit\Framework\TestCase::doesNotPerformAssertions | ( | ) |
|
static |
Returns a matcher that matches when the method is executed exactly $count times.
int | $count |
PHPUnit\Framework\TestCase::expectException | ( | $exception | ) |
string | $exception |
PHPUnit\Framework\TestCase::expectExceptionCode | ( | $code | ) |
int | string | $code |
Exception |
PHPUnit\Framework\TestCase::expectExceptionMessage | ( | $message | ) |
string | $message |
Exception |
PHPUnit\Framework\TestCase::expectExceptionMessageRegExp | ( | $messageRegExp | ) |
string | $messageRegExp |
Exception |
PHPUnit\Framework\TestCase::expectExceptionObject | ( | \Exception | $exception | ) |
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.
PHPUnit\Framework\TestCase::expectOutputRegex | ( | $expectedRegex | ) |
string | $expectedRegex |
Exception |
PHPUnit\Framework\TestCase::expectOutputString | ( | $expectedString | ) |
string | $expectedString |
PHPUnit\Framework\TestCase::getActualOutput | ( | ) |
PHPUnit\Framework\TestCase::getAnnotations | ( | ) |
Returns the annotations for this test.
PHPUnit\Framework\TestCase::getDataSetAsString | ( | $includeData = true | ) |
PHPUnit\Framework\TestCase::getExpectedException | ( | ) |
PHPUnit\Framework\TestCase::getExpectedExceptionCode | ( | ) |
PHPUnit\Framework\TestCase::getExpectedExceptionMessage | ( | ) |
PHPUnit\Framework\TestCase::getExpectedExceptionMessageRegExp | ( | ) |
PHPUnit\Framework\TestCase::getMockBuilder | ( | $className | ) |
Returns a builder object to create mock objects using a fluent interface.
string | string[] | $className |
|
protected |
Mocks the specified class and returns the name of the mocked class.
string | $originalClassName | |
array | $methods | |
array | $arguments | |
string | $mockClassName | |
bool | $callOriginalConstructor | |
bool | $callOriginalClone | |
bool | $callAutoload | |
bool | $cloneArguments |
Exception |
|
protected |
Returns 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).
string | $originalClassName | |
array | $arguments | |
string | $mockClassName | |
bool | $callOriginalConstructor | |
bool | $callOriginalClone | |
bool | $callAutoload | |
array | $mockedMethods | |
bool | $cloneArguments |
Exception |
|
protected |
Returns 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.
string | $traitName | |
array | $arguments | |
string | $mockClassName | |
bool | $callOriginalConstructor | |
bool | $callOriginalClone | |
bool | $callAutoload | |
array | $mockedMethods | |
bool | $cloneArguments |
Exception |
|
protected |
Returns a mock object based on the given WSDL file.
string | $wsdlFile | |
string | $originalClassName | |
string | $mockClassName | |
array | $methods | |
bool | $callOriginalConstructor | |
array | $options | An array of options passed to SOAPClient::_construct |
PHPUnit\Framework\TestCase::getName | ( | $withDataSet = true | ) |
PHPUnit\Framework\TestCase::getNumAssertions | ( | ) |
Returns the number of assertions performed by this test.
|
protected |
Returns an object for the specified trait.
string | $traitName | |
array | $arguments | |
string | $traitClassName | |
bool | $callOriginalConstructor | |
bool | $callOriginalClone | |
bool | $callAutoload |
Exception |
|
protected |
Gets the data set of a TestCase.
PHPUnit\Framework\TestCase::getResult | ( | ) |
PHPUnit\Framework\TestCase::getSize | ( | ) |
Returns the size of the test.
PHPUnit\Framework\TestCase::getStatus | ( | ) |
Returns the status of this test.
PHPUnit\Framework\TestCase::getStatusMessage | ( | ) |
Returns the status message of this test.
PHPUnit\Framework\TestCase::getTestResultObject | ( | ) |
PHPUnit\Framework\TestCase::hasDependencies | ( | ) |
Returns true if the tests has dependencies
PHPUnit\Framework\TestCase::hasExpectationOnOutput | ( | ) |
PHPUnit\Framework\TestCase::hasFailed | ( | ) |
Returns whether or not this test has failed.
PHPUnit\Framework\TestCase::hasOutput | ( | ) |
PHPUnit\Framework\TestCase::hasSize | ( | ) |
|
protected |
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.
string | $varName | |
string | $newValue |
Exception |
PHPUnit\Framework\TestCase::isInIsolation | ( | ) |
PHPUnit\Framework\TestCase::isLarge | ( | ) |
PHPUnit\Framework\TestCase::isMedium | ( | ) |
PHPUnit\Framework\TestCase::isSmall | ( | ) |
|
static |
Returns a matcher that matches when the method is never executed.
|
static |
Returns a matcher that matches when the method is executed exactly once.
|
static |
mixed | $value,... |
|
protected |
This method is called when a test method did not execute successfully.
Throwable | $t |
Throwable |
|
protected |
Performs custom preparations on the process isolation template.
Text_Template | $template |
|
protected |
string | null | $classOrInterface |
PHPUnit\Framework\TestCase::registerMockObject | ( | MockObject | $mockObject | ) |
MockObject | $mockObject |
|
static |
int | $argumentIndex |
|
static |
mixed | $callback |
|
static |
Returns the current object.
This method is useful when mocking a fluent interface.
|
static |
mixed | $value |
|
static |
array | $valueMap |
PHPUnit\Framework\TestCase::run | ( | TestResult | $result = null | ) |
Runs the test case and collects the results in a TestResult object. If no TestResult object is passed a new one will be created.
TestResult | $result |
Exception |
Implements PHPUnit\Framework\Test.
PHPUnit\Framework\TestCase::runBare | ( | ) |
Runs the bare test sequence.
|
protected |
Override to run the test and assert its state.
Exception|Exception | |
Exception |
Reimplemented in PHPUnit\Framework\IncompleteTestCase, PHPUnit\Framework\SkippedTestCase, PHPUnit\Framework\WarningTestCase, WasRun, Failure, Success, TestIncomplete, TestSkipped, and TestError.
PHPUnit\Framework\TestCase::setBackupGlobals | ( | $backupGlobals | ) |
Calling this method in setUp() has no effect!
bool | $backupGlobals |
PHPUnit\Framework\TestCase::setBackupStaticAttributes | ( | $backupStaticAttributes | ) |
Calling this method in setUp() has no effect!
bool | $backupStaticAttributes |
PHPUnit\Framework\TestCase::setBeStrictAboutChangesToGlobalState | ( | $beStrictAboutChangesToGlobalState | ) |
bool | $beStrictAboutChangesToGlobalState |
PHPUnit\Framework\TestCase::setDependencies | ( | array | $dependencies | ) |
Sets the dependencies of a TestCase.
string[] | $dependencies |
PHPUnit\Framework\TestCase::setDependencyInput | ( | array | $dependencyInput | ) |
Sets
array | $dependencyInput |
PHPUnit\Framework\TestCase::setGroups | ( | array | $groups | ) |
array | $groups |
PHPUnit\Framework\TestCase::setInIsolation | ( | $inIsolation | ) |
bool | $inIsolation |
Exception |
|
protected |
This method is a wrapper for the setlocale() function that automatically resets the locale to its original value after the test is run.
int | $category | |
string | $locale |
Exception |
PHPUnit\Framework\TestCase::setName | ( | $name | ) |
Sets the name of a TestCase.
string |
PHPUnit\Framework\TestCase::setOutputCallback | ( | $callback | ) |
callable | $callback |
Exception |
PHPUnit\Framework\TestCase::setPreserveGlobalState | ( | $preserveGlobalState | ) |
bool | $preserveGlobalState |
Exception |
PHPUnit\Framework\TestCase::setRegisterMockObjectsFromTestArgumentsRecursively | ( | $flag | ) |
bool | $flag |
PHPUnit\Framework\TestCase::setResult | ( | $result | ) |
mixed | $result |
PHPUnit\Framework\TestCase::setRunClassInSeparateProcess | ( | $runClassInSeparateProcess | ) |
bool | $runClassInSeparateProcess |
Exception |
PHPUnit\Framework\TestCase::setRunTestInSeparateProcess | ( | $runTestInSeparateProcess | ) |
bool | $runTestInSeparateProcess |
Exception |
PHPUnit\Framework\TestCase::setTestResultObject | ( | TestResult | $result | ) |
TestResult | $result |
|
protected |
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Reimplemented in PHPUnit\Framework\TestListenerTest, PharIo\Manifest\ManifestTest, PHPUnit\Runner\PhptTestCaseTest, PharIo\Manifest\CopyrightInformationTest, PharIo\Manifest\ExtensionTest, GeneratorTest, SebastianBergmann\Diff\LongestCommonSubsequenceTest, PharIo\Manifest\BundledComponentCollectionTest, PharIo\Manifest\RequirementCollectionTest, PharIo\Manifest\AuthorCollectionTest, SebastianBergmann\Comparator\DateTimeComparatorTest, SebastianBergmann\GlobalState\BlacklistTest, SebastianBergmann\GlobalState\SnapshotTest, SebastianBergmann\Comparator\ArrayComparatorTest, SebastianBergmann\Diff\ParserTest, SebastianBergmann\ObjectReflector\ObjectReflectorTest, SebastianBergmann\Comparator\DOMNodeComparatorTest, SebastianBergmann\Comparator\ExceptionComparatorTest, SebastianBergmann\Comparator\SplObjectStorageComparatorTest, PharIo\Manifest\BundledComponentTest, PharIo\Manifest\PhpVersionRequirementTest, SebastianBergmann\CodeCoverage\FilterTest, SebastianBergmann\Comparator\MockObjectComparatorTest, SebastianBergmann\Comparator\ObjectComparatorTest, SebastianBergmann\Comparator\TypeComparatorTest, SebastianBergmann\Environment\ConsoleTest, SebastianBergmann\Environment\OperatingSystemTest, SebastianBergmann\Environment\RuntimeTest, PharIo\Manifest\AuthorTest, PharIo\Manifest\LicenseTest, SebastianBergmann\CodeCoverage\CodeCoverageTest, SebastianBergmann\Comparator\DoubleComparatorTest, SebastianBergmann\Comparator\NumericComparatorTest, SebastianBergmann\Comparator\ResourceComparatorTest, SebastianBergmann\Comparator\ScalarComparatorTest, SebastianBergmann\ObjectEnumerator\EnumeratorTest, PharIo\Manifest\ApplicationTest, PharIo\Manifest\LibraryTest, PHP_Token_ClassTest, PHP_Token_InterfaceTest, SebastianBergmann\CodeUnitReverseLookup\WizardTest, SebastianBergmann\Diff\ChunkTest, SebastianBergmann\Diff\LineTest, SebastianBergmann\Exporter\ExporterTest, SebastianBergmann\RecursionContext\ContextTest, PHPUnit\Util\ConfigurationTest, PHPUnit\Util\PHP\AbstractPhpProcessTest, SebastianBergmann\Diff\DifferTestTest, PHPUnit\Util\TestDox\NamePrettifierTest, SebastianBergmann\CodeCoverage\Report\BuilderTest, PHP_Token_ClosureTest, PHP_Token_FunctionTest, PHP_Token_IncludeTest, PHPUnit\Framework\SuiteTest, BankAccountTest, BankAccountWithCustomExtensionTest, BankAccountTest, ExceptionInAssertPostConditionsTest, ExceptionInAssertPreConditionsTest, ExceptionInSetUpTest, ExceptionInTearDownTest, ExceptionInTest, TemplateMethodsTest, BankAccountTest, and Issue1374Test.
|
static |
This method is called before the first test of this test class is run.
Reimplemented in SebastianBergmann\CodeCoverage\TestCase, PHPUnit\Framework\TestCaseTest, SebastianBergmann\GlobalState\RestorerTest, SebastianBergmann\CodeCoverage\Report\Html\HTMLTest, SebastianBergmann\CodeCoverage\Report\Xml\XMLTest, ServersTest, BeforeClassWithOnlyDataProviderTest, AdminConfigTest, ConfigTest, RequirementsClassBeforeClassHookTest, ClonedDependencyTest, TemplateMethodsTest, and Issue2145Test.
PHPUnit\Framework\TestCase::setUseErrorHandler | ( | $useErrorHandler | ) |
bool | $useErrorHandler |
|
protected |
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Reimplemented in PHPUnit\Runner\PhptTestCaseTest, SebastianBergmann\Diff\LongestCommonSubsequenceTest, TemplateMethodsTest, ExceptionInAssertPostConditionsTest, ExceptionInAssertPreConditionsTest, ExceptionInSetUpTest, ExceptionInTest, ExceptionInTearDownTest, SebastianBergmann\CodeCoverage\Report\Html\HTMLTest, SebastianBergmann\CodeCoverage\Report\Xml\XMLTest, and Issue1374Test.
|
static |
This method is called after the last test of this test class is run.
Reimplemented in TemplateMethodsTest, and PHPUnit\Framework\TestCaseTest.
|
static |
Throwable | $exception |
PHPUnit\Framework\TestCase::toString | ( | ) |
Returns a string representation of the test case.
Implements PHPUnit\Framework\SelfDescribing.
Reimplemented in PHPUnit\Framework\IncompleteTestCase, PHPUnit\Framework\SkippedTestCase, and PHPUnit\Framework\WarningTestCase.
PHPUnit\Framework\TestCase::usesDataProvider | ( | ) |
|
protected |
Verifies the mock object expectations.