diff --git a/src/assertions.rst b/src/assertions.rst index 9df8a5051..50929c28d 100644 --- a/src/assertions.rst +++ b/src/assertions.rst @@ -2452,14 +2452,14 @@ assertThat() ############ More complex assertions can be formulated using the -``PHPUnit_Framework_Constraint`` classes. They can be +``PHPUnit\Framework\Constraint`` classes. They can be evaluated using the ``assertThat()`` method. :numref:`appendixes.assertions.assertThat.example` shows how the ``logicalNot()`` and ``equalTo()`` constraints can be used to express the same assertion as ``assertNotEquals()``. -``assertThat(mixed $value, PHPUnit_Framework_Constraint $constraint[, $message = ''])`` +``assertThat(mixed $value, PHPUnit\Framework\Constraint $constraint[, $message = ''])`` Reports an error identified by ``$message`` if the ``$value`` does not match the ``$constraint``. @@ -2488,7 +2488,7 @@ Reports an error identified by ``$message`` if the ``$value`` does not match the ?> :numref:`appendixes.assertions.assertThat.tables.constraints` shows the -available ``PHPUnit_Framework_Constraint`` classes. +available ``PHPUnit\Framework\Constraint`` classes. .. rst-class:: table .. list-table:: Constraints @@ -2497,71 +2497,71 @@ available ``PHPUnit_Framework_Constraint`` classes. * - Constraint - Meaning - * - ``PHPUnit_Framework_Constraint_Attribute attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)`` + * - ``PHPUnit\Framework\Constraint\Attribute attribute(PHPUnit\Framework\Constraint $constraint, $attributeName)`` - Constraint that applies another constraint to an attribute of a class or an object. - * - ``PHPUnit_Framework_Constraint_IsAnything anything()`` + * - ``PHPUnit\Framework\Constraint\IsAnything anything()`` - Constraint that accepts any input value. - * - ``PHPUnit_Framework_Constraint_ArrayHasKey arrayHasKey(mixed $key)`` + * - ``PHPUnit\Framework\Constraint\ArrayHasKey arrayHasKey(mixed $key)`` - Constraint that asserts that the array it is evaluated for has a given key. - * - ``PHPUnit_Framework_Constraint_TraversableContains contains(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\TraversableContains contains(mixed $value)`` - Constraint that asserts that the ``array`` or object that implements the ``Iterator`` interface it is evaluated for contains a given value. - * - ``PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnly(string $type)`` + * - ``PHPUnit\Framework\Constraint\TraversableContainsOnly containsOnly(string $type)`` - Constraint that asserts that the ``array`` or object that implements the ``Iterator`` interface it is evaluated for contains only values of a given type. - * - ``PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnlyInstancesOf(string $classname)`` + * - ``PHPUnit\Framework\Constraint\TraversableContainsOnly containsOnlyInstancesOf(string $classname)`` - Constraint that asserts that the ``array`` or object that implements the ``Iterator`` interface it is evaluated for contains only instances of a given classname. - * - ``PHPUnit_Framework_Constraint_IsEqual equalTo($value, $delta = 0, $maxDepth = 10)`` + * - ``PHPUnit\Framework\Constraint\IsEqual equalTo($value, $delta = 0, $maxDepth = 10)`` - Constraint that checks if one value is equal to another. - * - ``PHPUnit_Framework_Constraint_Attribute attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10)`` + * - ``PHPUnit\Framework\Constraint\Attribute attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10)`` - Constraint that checks if a value is equal to an attribute of a class or of an object. - * - ``PHPUnit_Framework_Constraint_DirectoryExists directoryExists()`` + * - ``PHPUnit\Framework\Constraint\DirectoryExists directoryExists()`` - Constraint that checks if the directory that it is evaluated for exists. - * - ``PHPUnit_Framework_Constraint_FileExists fileExists()`` + * - ``PHPUnit\Framework\Constraint\FileExists fileExists()`` - Constraint that checks if the file(name) that it is evaluated for exists. - * - ``PHPUnit_Framework_Constraint_IsReadable isReadable()`` + * - ``PHPUnit\Framework\Constraint\IsReadable isReadable()`` - Constraint that checks if the file(name) that it is evaluated for is readable. - * - ``PHPUnit_Framework_Constraint_IsWritable isWritable()`` + * - ``PHPUnit\Framework\Constraint\IsWritable isWritable()`` - Constraint that checks if the file(name) that it is evaluated for is writable. - * - ``PHPUnit_Framework_Constraint_GreaterThan greaterThan(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\GreaterThan greaterThan(mixed $value)`` - Constraint that asserts that the value it is evaluated for is greater than a given value. - * - ``PHPUnit_Framework_Constraint_Or greaterThanOrEqual(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\Or greaterThanOrEqual(mixed $value)`` - Constraint that asserts that the value it is evaluated for is greater than or equal to a given value. - * - ``PHPUnit_Framework_Constraint_ClassHasAttribute classHasAttribute(string $attributeName)`` + * - ``PHPUnit\Framework\Constraint\ClassHasAttribute classHasAttribute(string $attributeName)`` - Constraint that asserts that the class it is evaluated for has a given attribute. - * - ``PHPUnit_Framework_Constraint_ClassHasStaticAttribute classHasStaticAttribute(string $attributeName)`` + * - ``PHPUnit\Framework\Constraint\ClassHasStaticAttribute classHasStaticAttribute(string $attributeName)`` - Constraint that asserts that the class it is evaluated for has a given static attribute. - * - ``PHPUnit_Framework_Constraint_ObjectHasAttribute hasAttribute(string $attributeName)`` + * - ``PHPUnit\Framework\Constraint\ObjectHasAttribute hasAttribute(string $attributeName)`` - Constraint that asserts that the object it is evaluated for has a given attribute. - * - ``PHPUnit_Framework_Constraint_IsIdentical identicalTo(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\IsIdentical identicalTo(mixed $value)`` - Constraint that asserts that one value is identical to another. - * - ``PHPUnit_Framework_Constraint_IsFalse isFalse()`` + * - ``PHPUnit\Framework\Constraint\IsFalse isFalse()`` - Constraint that asserts that the value it is evaluated is ``false``. - * - ``PHPUnit_Framework_Constraint_IsInstanceOf isInstanceOf(string $className)`` + * - ``PHPUnit\Framework\Constraint\IsInstanceOf isInstanceOf(string $className)`` - Constraint that asserts that the object it is evaluated for is an instance of a given class. - * - ``PHPUnit_Framework_Constraint_IsNull isNull()`` + * - ``PHPUnit\Framework\Constraint\IsNull isNull()`` - Constraint that asserts that the value it is evaluated is ``null``. - * - ``PHPUnit_Framework_Constraint_IsTrue isTrue()`` + * - ``PHPUnit\Framework\Constraint\IsTrue isTrue()`` - Constraint that asserts that the value it is evaluated is ``true``. - * - ``PHPUnit_Framework_Constraint_IsType isType(string $type)`` + * - ``PHPUnit\Framework\Constraint\IsType isType(string $type)`` - Constraint that asserts that the value it is evaluated for is of a specified type. - * - ``PHPUnit_Framework_Constraint_LessThan lessThan(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\LessThan lessThan(mixed $value)`` - Constraint that asserts that the value it is evaluated for is smaller than a given value. - * - ``PHPUnit_Framework_Constraint_Or lessThanOrEqual(mixed $value)`` + * - ``PHPUnit\Framework\Constraint\Or lessThanOrEqual(mixed $value)`` - Constraint that asserts that the value it is evaluated for is smaller than or equal to a given value. * - ``logicalAnd()`` - Logical AND. - * - ``logicalNot(PHPUnit_Framework_Constraint $constraint)`` + * - ``logicalNot(PHPUnit\Framework\Constraint $constraint)`` - Logical NOT. * - ``logicalOr()`` - Logical OR. * - ``logicalXor()`` - Logical XOR. - * - ``PHPUnit_Framework_Constraint_PCREMatch matchesRegularExpression(string $pattern)`` + * - ``PHPUnit\Framework\Constraint\PCREMatch matchesRegularExpression(string $pattern)`` - Constraint that asserts that the string it is evaluated for matches a regular expression. - * - ``PHPUnit_Framework_Constraint_StringContains stringContains(string $string, bool $case)`` + * - ``PHPUnit\Framework\Constraint\StringContains stringContains(string $string, bool $case)`` - Constraint that asserts that the string it is evaluated for contains a given string. - * - ``PHPUnit_Framework_Constraint_StringEndsWith stringEndsWith(string $suffix)`` + * - ``PHPUnit\Framework\Constraint\StringEndsWith stringEndsWith(string $suffix)`` - Constraint that asserts that the string it is evaluated for ends with a given suffix. - * - ``PHPUnit_Framework_Constraint_StringStartsWith stringStartsWith(string $prefix)`` + * - ``PHPUnit\Framework\Constraint\StringStartsWith stringStartsWith(string $prefix)`` - Constraint that asserts that the string it is evaluated for starts with a given prefix. .. _appendixes.assertions.assertTrue: diff --git a/src/code-coverage-analysis.rst b/src/code-coverage-analysis.rst index 6765afcde..54f89c9d2 100644 --- a/src/code-coverage-analysis.rst +++ b/src/code-coverage-analysis.rst @@ -283,9 +283,9 @@ generate code coverage with unit tests. :name: code-coverage-analysis.specifying-covered-methods.examples.GuestbookIntegrationTest.php processIsolation="false" stopOnError="false" @@ -37,7 +37,7 @@ be used to configure PHPUnit's core functionality. stopOnIncomplete="false" stopOnSkipped="false" stopOnRisky="false" - testSuiteLoaderClass="PHPUnit_Runner_StandardTestSuiteLoader" + testSuiteLoaderClass="PHPUnit\Runner\StandardTestSuiteLoader" timeoutForSmallTests="1" timeoutForMediumTests="10" diff --git a/src/database.rst b/src/database.rst index a28c70ad6..8660e1a54 100644 --- a/src/database.rst +++ b/src/database.rst @@ -228,7 +228,7 @@ abstract TestCase requiring you to implement two abstract methods use TestCaseTrait; /** - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ public function getConnection() { @@ -237,7 +237,7 @@ abstract TestCase requiring you to implement two abstract methods } /** - * @return PHPUnit_Extensions_Database_DataSet_IDataSet + * @return PHPUnit\DbUnit\DataSet\IDataSet */ public function getDataSet() { @@ -263,7 +263,7 @@ and pass it to the ``createDefaultDBConnection`` method which wraps the PDO instance and the second parameter (the database-name) in a very simple abstraction layer for database connections of the type -``PHPUnit_Extensions_Database_DB_IDatabaseConnection``. +``PHPUnit\DbUnit\Database\Connection``. The section “Using the Database Connection API“ explains the API of this interface and how you can make the best use of it. @@ -278,8 +278,8 @@ state of the database should look before each test is executed. The state of a database is abstracted through the concepts DataSet and DataTable both being represented by the interfaces -``PHPUnit_Extensions_Database_DataSet_IDataSet`` and -``PHPUnit_Extensions_Database_DataSet_IDataTable``. +``PHPUnit\DbUnit\DataSet\IDataSet`` and +``PHPUnit\DbUnit\DataSet\IDataTable``. The next section will describe in detail how these concepts work and what the benefits are for using them in database testing. @@ -345,7 +345,7 @@ different data-fixture for each test case: // only instantiate pdo once for test clean-up/fixture load static private $pdo = null; - // only instantiate PHPUnit_Extensions_Database_DB_IDatabaseConnection once per test + // only instantiate PHPUnit\DbUnit\Database\Connection once per test private $conn = null; final public function getConnection() @@ -397,7 +397,7 @@ We can now modify our test-case to look like: // only instantiate pdo once for test clean-up/fixture load static private $pdo = null; - // only instantiate PHPUnit_Extensions_Database_DB_IDatabaseConnection once per test + // only instantiate PHPUnit\DbUnit\Database\Connection once per test private $conn = null; final public function getConnection() @@ -877,7 +877,13 @@ straightforward: .. code-block:: php addRow($row); @@ -907,7 +913,7 @@ straightforward: protected function createIterator($reverse = false) { - return new PHPUnit_Extensions_Database_DataSet_DefaultTableIterator($this->tables, $reverse); + return new DefaultTableIterator($this->tables, $reverse); } public function getTable($tableName) @@ -933,7 +939,7 @@ contents of the database. This is where the Query DataSet shines: .. code-block:: php getConnection()); + $ds = new PHPUnit\DbUnit\DataSet\QueryDataSet($this->getConnection()); $ds->addTable('guestbook'); ?> @@ -943,7 +949,7 @@ data-table with the following query: .. code-block:: php getConnection()); + $ds = new PHPUnit\DbUnit\DataSet\QueryDataSet($this->getConnection()); $ds->addTable('guestbook', 'SELECT * FROM guestbook'); ?> @@ -954,7 +960,7 @@ tables, for example restricting rows, column or adding .. code-block:: php getConnection()); + $ds = new PHPUnit\DbUnit\DataSet\QueryDataSet($this->getConnection()); $ds->addTable('guestbook', 'SELECT id, content FROM guestbook ORDER BY created DESC'); ?> @@ -987,7 +993,7 @@ specified table names with a whitelist as shown in use TestCaseTrait; /** - * @return PHPUnit_Extensions_Database_DB_IDatabaseConnection + * @return PHPUnit\DbUnit\Database\Connection */ public function getConnection() { @@ -1050,7 +1056,7 @@ We then wrap the Flat XML DataSet into a Replacement DataSet: public function getDataSet() { $ds = $this->createFlatXmlDataSet('myFlatXmlFixture.xml'); - $rds = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($ds); + $rds = new PHPUnit\DbUnit\DataSet\ReplacementDataSet($ds); $rds->addFullReplacement('##NULL##', null); return $rds; } @@ -1082,7 +1088,7 @@ with the DB DataSet to filter the columns of the datasets. $tableNames = ['guestbook']; $dataSet = $this->getConnection()->createDataSet(); - $filterDataSet = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($dataSet); + $filterDataSet = new PHPUnit\DbUnit\DataSet\DataSetFilter($dataSet); $filterDataSet->addIncludeTables(['guestbook']); $filterDataSet->setIncludeColumnsForTable('guestbook', ['id', 'content']); // .. @@ -1093,14 +1099,14 @@ with the DB DataSet to filter the columns of the datasets. $tableNames = ['guestbook']; $dataSet = $this->getConnection()->createDataSet(); - $filterDataSet = new PHPUnit_Extensions_Database_DataSet_DataSetFilter($dataSet); + $filterDataSet = new PHPUnit\DbUnit\DataSet\DataSetFilter($dataSet); $filterDataSet->addExcludeTables(['foo', 'bar', 'baz']); // only keep the guestbook table! $filterDataSet->setExcludeColumnsForTable('guestbook', ['user', 'created']); // .. } } ?> - + .. admonition:: Note You cannot use both exclude and include column filtering on the same table, @@ -1151,7 +1157,7 @@ Using the Composite DataSet we can aggregate both fixture files: $ds1 = $this->createFlatXmlDataSet('fixture1.xml'); $ds2 = $this->createFlatXmlDataSet('fixture2.xml'); - $compositeDs = new PHPUnit_Extensions_Database_DataSet_CompositeDataSet(); + $compositeDs = new PHPUnit\DbUnit\DataSet\CompositeDataSet(); $compositeDs->addDataSet($ds1); $compositeDs->addDataSet($ds2); @@ -1183,12 +1189,14 @@ do not plan to implement your own DataSet or DataTable. .. code-block:: php @@ -1230,7 +1240,7 @@ the different assertions of the Database Extension that are explained in the next chapter. The ``getTableMetaData()`` method has to return an implementation of the -``PHPUnit_Extensions_Database_DataSet_ITableMetaData`` +``PHPUnit\DbUnit\DataSet\ITableMetaData`` interface, which describes the structure of the table. It holds information on: @@ -1263,7 +1273,9 @@ which has to be returned from the .. code-block:: php addTable('guestbook', 'SELECT id, content, user FROM guestbook'); // additional tables $expectedDataSet = $this->createFlatXmlDataSet('guestbook.xml'); diff --git a/src/extending-phpunit.rst b/src/extending-phpunit.rst index 8209eed11..ecf31c50c 100644 --- a/src/extending-phpunit.rst +++ b/src/extending-phpunit.rst @@ -34,13 +34,15 @@ PHPUnit's own assertions are implemented. As you can see in ``assertThat()`` for evaluation. .. code-block:: php - :caption: The assertTrue() and isTrue() methods of the PHPUnit_Framework_Assert class + :caption: The assertTrue() and isTrue() methods of the PHPUnit\Framework\Assert class :name: extending-phpunit.examples.Assert.php :numref:`extending-phpunit.examples.IsTrue.php` shows how -``PHPUnit_Framework_Constraint_IsTrue`` extends the +``PHPUnit\Framework\Constraint\IsTrue`` extends the abstract base class for matcher objects (or constraints), -``PHPUnit_Framework_Constraint``. +``PHPUnit\Framework\Constraint``. .. code-block:: php - :caption: The PHPUnit_Framework_Constraint_IsTrue class + :caption: The PHPUnit\Framework\Constraint\IsTrue class :name: extending-phpunit.examples.IsTrue.php getName()); } - public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) + public function addFailure(PHPUnit\Framework\Test $test, PHPUnit\Framework\AssertionFailedError $e, $time) { printf("Test '%s' failed.\n", $test->getName()); } - public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addIncompleteTest(PHPUnit\Framework\Test $test, Exception $e, $time) { printf("Test '%s' is incomplete.\n", $test->getName()); } - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addRiskyTest(PHPUnit\Framework\Test $test, Exception $e, $time) { printf("Test '%s' is deemed risky.\n", $test->getName()); } - public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) + public function addSkippedTest(PHPUnit\Framework\Test $test, Exception $e, $time) { printf("Test '%s' has been skipped.\n", $test->getName()); } - public function startTest(PHPUnit_Framework_Test $test) + public function startTest(PHPUnit\Framework\Test $test) { printf("Test '%s' started.\n", $test->getName()); } - public function endTest(PHPUnit_Framework_Test $test, $time) + public function endTest(PHPUnit\Framework\Test $test, $time) { printf("Test '%s' ended.\n", $test->getName()); } - public function startTestSuite(PHPUnit_Framework_TestSuite $suite) + public function startTestSuite(PHPUnit\Framework\TestSuite $suite) { printf("TestSuite '%s' started.\n", $suite->getName()); } - public function endTestSuite(PHPUnit_Framework_TestSuite $suite) + public function endTestSuite(PHPUnit\Framework\TestSuite $suite) { printf("TestSuite '%s' ended.\n", $suite->getName()); } @@ -184,7 +188,7 @@ interface. ?> :numref:`extending-phpunit.examples.BaseTestListener.php` -shows how to subclass the ``PHPUnit_Framework_BaseTestListener`` +shows how to subclass the ``PHPUnit\Framework\BaseTestListener`` abstract class, which lets you specify only the interface methods that are interesting for your use case, while providing empty implementations for all the others. @@ -194,11 +198,11 @@ for all the others. :name: extending-phpunit.examples.BaseTestListener.php getName()); } @@ -241,7 +245,7 @@ test decorator that illustrates how to write your own test decorators. { private $timesRepeat = 1; - public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1) + public function __construct(PHPUnit\Framework\Test $test, $timesRepeat = 1) { parent::__construct($test); @@ -256,7 +260,7 @@ test decorator that illustrates how to write your own test decorators. return $this->timesRepeat * $this->test->count(); } - public function run(PHPUnit_Framework_TestResult $result = null) + public function run(PHPUnit\Framework\TestResult $result = null) { if ($result === null) { $result = $this->createResult(); @@ -273,12 +277,12 @@ test decorator that illustrates how to write your own test decorators. .. _extending-phpunit.PHPUnit_Framework_Test: -Implement PHPUnit_Framework_Test +Implement PHPUnit\Framework\Test ################################ -The ``PHPUnit_Framework_Test`` interface is narrow and +The ``PHPUnit\Framework\Test`` interface is narrow and easy to implement. You can write an implementation of -``PHPUnit_Framework_Test`` that is simpler than +``PHPUnit\Framework\Test`` that is simpler than ``PHPUnit\Framework\TestCase`` and that runs *data-driven tests*, for instance. @@ -295,7 +299,7 @@ and the second value is the actual one. lines as $line) { @@ -323,12 +327,12 @@ and the second value is the actual one. list($expected, $actual) = explode(';', $line); try { - PHPUnit_Framework_Assert::assertEquals( + PHPUnit\Framework\Assert::assertEquals( trim($expected), trim($actual) ); } - catch (PHPUnit_Framework_AssertionFailedError $e) { + catch (PHPUnit\Framework\AssertionFailedError $e) { $stopTime = PHP_Timer::stop(); $result->addFailure($this, $e, $stopTime); } @@ -350,7 +354,7 @@ and the second value is the actual one. } $test = new DataDrivenTest('data_file.csv'); - $result = PHPUnit_TextUI_TestRunner::run($test); + $result = PHPUnit\TextUI\TestRunner::run($test); ?> .. code-block:: bash diff --git a/src/incomplete-and-skipped-tests.rst b/src/incomplete-and-skipped-tests.rst index 2ff157539..0bf4f010c 100644 --- a/src/incomplete-and-skipped-tests.rst +++ b/src/incomplete-and-skipped-tests.rst @@ -33,17 +33,17 @@ test as a success. If we think of a successful test as a green light and a test failure as a red light, we need an additional yellow light to mark a test as being incomplete or not yet implemented. -``PHPUnit_Framework_IncompleteTest`` is a marker +``PHPUnit\Framework\IncompleteTest`` is a marker interface for marking an exception that is raised by a test method as the result of the test being incomplete or currently not implemented. -``PHPUnit_Framework_IncompleteTestError`` is the +``PHPUnit\Framework\IncompleteTestError`` is the standard implementation of this interface. :numref:`incomplete-and-skipped-tests.incomplete-tests.examples.SampleTest.php` shows a test case class, ``SampleTest``, that contains one test method, ``testSomething()``. By calling the convenience method ``markTestIncomplete()`` (which automatically -raises an ``PHPUnit_Framework_IncompleteTestError`` +raises an ``PHPUnit\Framework\IncompleteTestError`` exception) in the test method, we mark the test as being incomplete. .. code-block:: php diff --git a/src/logging.rst b/src/logging.rst index 774f4702c..0c93bf065 100644 --- a/src/logging.rst +++ b/src/logging.rst @@ -66,7 +66,7 @@ shows how failures and errors are denoted. line="6" assertions="1" time="0.011456"> - + testFailure(FailureErrorTest) Failed asserting that <integer:2> matches expected value <integer:1>. diff --git a/src/test-doubles.rst b/src/test-doubles.rst index d298fe120..dfd363cec 100644 --- a/src/test-doubles.rst +++ b/src/test-doubles.rst @@ -706,17 +706,17 @@ invocations. * - Matcher - Meaning - * - ``PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount any()`` + * - ``PHPUnit\Framework\MockObject\Matcher\AnyInvokedCount any()`` - Returns a matcher that matches when the method it is evaluated for is executed zero or more times. - * - ``PHPUnit_Framework_MockObject_Matcher_InvokedCount never()`` + * - ``PHPUnit\Framework\MockObject\Matcher\InvokedCount never()`` - Returns a matcher that matches when the method it is evaluated for is never executed. - * - ``PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce atLeastOnce()`` + * - ``PHPUnit\Framework\MockObject\Matcher\InvokedAtLeastOnce atLeastOnce()`` - Returns a matcher that matches when the method it is evaluated for is executed at least once. - * - ``PHPUnit_Framework_MockObject_Matcher_InvokedCount once()`` + * - ``PHPUnit\Framework\MockObject\Matcher\InvokedCount once()`` - Returns a matcher that matches when the method it is evaluated for is executed exactly once. - * - ``PHPUnit_Framework_MockObject_Matcher_InvokedCount exactly(int $count)`` + * - ``PHPUnit\Framework\MockObject\Matcher\InvokedCount exactly(int $count)`` - Returns a matcher that matches when the method it is evaluated for is executed exactly ``$count`` times. - * - ``PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex at(int $index)`` + * - ``PHPUnit\Framework\MockObject\Matcher\InvokedAtIndex at(int $index)`` - Returns a matcher that matches when the method it is evaluated for is invoked at the given ``$index``. .. admonition:: Note diff --git a/src/textui.rst b/src/textui.rst index e4484f07d..c3b5e0ff3 100644 --- a/src/textui.rst +++ b/src/textui.rst @@ -176,9 +176,9 @@ the following code: ``UnitTest`` must be either a class that inherits from ``PHPUnit\Framework\TestCase`` or a class that provides a ``public static suite()`` method which - returns a ``PHPUnit_Framework_Test`` object, for + returns a ``PHPUnit\Framework\Test`` object, for example an instance of the - ``PHPUnit_Framework_TestSuite`` class. + ``PHPUnit\Framework\TestSuite`` class. ``phpunit UnitTest UnitTest.php`` @@ -443,7 +443,7 @@ the following code: ``--loader`` - Specifies the ``PHPUnit_Runner_TestSuiteLoader`` + Specifies the ``PHPUnit\Runner\TestSuiteLoader`` implementation to use. The standard test suite loader will look for the sourcefile in the @@ -465,7 +465,7 @@ the following code: ``--printer`` Specifies the result printer to use. The printer class must extend - ``PHPUnit_Util_Printer`` and implement the + ``PHPUnit\Util\Printer`` and implement the ``PHPUnit\Framework\TestListener`` interface. ``--bootstrap``