Loading core/lib/Drupal/Core/Test/TestDiscovery.php +4 −4 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Test\Exception\MissingGroupException; use PHPUnit_Util_Test; use PHPUnit\Util\Test; /** * Discovers available tests. Loading Loading @@ -418,14 +418,14 @@ public static function parseTestClassSummary($doc_comment) { * - module: A list of Drupal module dependencies that are required to * exist. * * @see PHPUnit_Util_Test::parseTestMethodAnnotations() * @see \PHPUnit\Util\Test::parseTestMethodAnnotations() * @see http://phpunit.de/manual/current/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.skipping-tests-using-requires */ public static function parseTestClassAnnotations(\ReflectionClass $class) { $annotations = PHPUnit_Util_Test::parseTestMethodAnnotations($class->getName())['class']; $annotations = Test::parseTestMethodAnnotations($class->getName())['class']; // @todo Enhance PHPUnit upstream to allow for custom @requires identifiers. // @see PHPUnit_Util_Test::getRequirements() // @see \PHPUnit\Util\Test::getRequirements() // @todo Add support for 'PHP', 'OS', 'function', 'extension'. // @see https://www.drupal.org/node/1273478 if (isset($annotations['requires'])) { Loading core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class AggregatorPluginSettingsBaseTest extends UnitTestCase { /** * The stubbed config factory object. * * @var \PHPUnit_Framework_MockObject_MockBuilder * @var \PHPUnit\Framework\MockObject\MockBuilder */ protected $configFactory; Loading Loading @@ -56,7 +56,7 @@ protected function setUp() { ->will($this->returnValue(['aggregator_test' => ['title' => '', 'description' => '']])); } /** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockBuilder $messenger */ /** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit\Framework\MockObject\MockBuilder $messenger */ $messenger = $this->createMock(MessengerInterface::class); $messenger->expects($this->any())->method('addMessage'); Loading core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php +3 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\Tests\field\Kernel\FieldKernelTestBase; use Drupal\field\Entity\FieldStorageConfig; use PHPUnit\Framework\AssertionFailedError; /** * Tests the new entity API for the date field type. Loading Loading @@ -255,7 +256,7 @@ public function testSetValueProperty() { * @dataProvider datetimeValidationProvider */ public function testDatetimeValidation($value) { $this->expectException(\PHPUnit_Framework_AssertionFailedError::class); $this->expectException(AssertionFailedError::class); $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME); $this->fieldStorage->save(); Loading Loading @@ -315,7 +316,7 @@ public function datetimeValidationProvider() { * @dataProvider dateonlyValidationProvider */ public function testDateonlyValidation($value) { $this->expectException(\PHPUnit_Framework_AssertionFailedError::class); $this->expectException(AssertionFailedError::class); $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE); $this->fieldStorage->save(); Loading core/modules/image/tests/src/Kernel/ImageItemTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\file\Entity\File; use Drupal\user\Entity\Role; use PHPUnit\Framework\Error\Warning; /** * Tests using entity fields of the image field type. Loading Loading @@ -153,7 +154,7 @@ public function testImageItemMalformed() { $this->fail('Exception did not fail'); } catch (EntityStorageException $exception) { $this->assertInstanceOf(\PHPUnit_Framework_Error_Warning::class, $exception->getPrevious()); $this->assertInstanceOf(Warning::class, $exception->getPrevious()); $this->assertEquals($exception->getMessage(), 'Missing file with ID 9999.'); $this->assertEmpty($entity->image_test->width); $this->assertEmpty($entity->image_test->height); Loading core/modules/locale/tests/src/Unit/LocaleLookupTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class LocaleLookupTest extends UnitTestCase { /** * A mocked config factory built with UnitTestCase::getConfigFactoryStub(). * * @var \Drupal\Core\Config\ConfigFactory|\PHPUnit_Framework_MockObject_MockBuilder * @var \Drupal\Core\Config\ConfigFactory|\PHPUnit\Framework\MockObject\MockBuilder */ protected $configFactory; Loading Loading
core/lib/Drupal/Core/Test/TestDiscovery.php +4 −4 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\Extension\ExtensionDiscovery; use Drupal\Core\Test\Exception\MissingGroupException; use PHPUnit_Util_Test; use PHPUnit\Util\Test; /** * Discovers available tests. Loading Loading @@ -418,14 +418,14 @@ public static function parseTestClassSummary($doc_comment) { * - module: A list of Drupal module dependencies that are required to * exist. * * @see PHPUnit_Util_Test::parseTestMethodAnnotations() * @see \PHPUnit\Util\Test::parseTestMethodAnnotations() * @see http://phpunit.de/manual/current/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.skipping-tests-using-requires */ public static function parseTestClassAnnotations(\ReflectionClass $class) { $annotations = PHPUnit_Util_Test::parseTestMethodAnnotations($class->getName())['class']; $annotations = Test::parseTestMethodAnnotations($class->getName())['class']; // @todo Enhance PHPUnit upstream to allow for custom @requires identifiers. // @see PHPUnit_Util_Test::getRequirements() // @see \PHPUnit\Util\Test::getRequirements() // @todo Add support for 'PHP', 'OS', 'function', 'extension'. // @see https://www.drupal.org/node/1273478 if (isset($annotations['requires'])) { Loading
core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ class AggregatorPluginSettingsBaseTest extends UnitTestCase { /** * The stubbed config factory object. * * @var \PHPUnit_Framework_MockObject_MockBuilder * @var \PHPUnit\Framework\MockObject\MockBuilder */ protected $configFactory; Loading Loading @@ -56,7 +56,7 @@ protected function setUp() { ->will($this->returnValue(['aggregator_test' => ['title' => '', 'description' => '']])); } /** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockBuilder $messenger */ /** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit\Framework\MockObject\MockBuilder $messenger */ $messenger = $this->createMock(MessengerInterface::class); $messenger->expects($this->any())->method('addMessage'); Loading
core/modules/datetime/tests/src/Kernel/DateTimeItemTest.php +3 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use Drupal\field\Entity\FieldConfig; use Drupal\Tests\field\Kernel\FieldKernelTestBase; use Drupal\field\Entity\FieldStorageConfig; use PHPUnit\Framework\AssertionFailedError; /** * Tests the new entity API for the date field type. Loading Loading @@ -255,7 +256,7 @@ public function testSetValueProperty() { * @dataProvider datetimeValidationProvider */ public function testDatetimeValidation($value) { $this->expectException(\PHPUnit_Framework_AssertionFailedError::class); $this->expectException(AssertionFailedError::class); $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATETIME); $this->fieldStorage->save(); Loading Loading @@ -315,7 +316,7 @@ public function datetimeValidationProvider() { * @dataProvider dateonlyValidationProvider */ public function testDateonlyValidation($value) { $this->expectException(\PHPUnit_Framework_AssertionFailedError::class); $this->expectException(AssertionFailedError::class); $this->fieldStorage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE); $this->fieldStorage->save(); Loading
core/modules/image/tests/src/Kernel/ImageItemTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\file\Entity\File; use Drupal\user\Entity\Role; use PHPUnit\Framework\Error\Warning; /** * Tests using entity fields of the image field type. Loading Loading @@ -153,7 +154,7 @@ public function testImageItemMalformed() { $this->fail('Exception did not fail'); } catch (EntityStorageException $exception) { $this->assertInstanceOf(\PHPUnit_Framework_Error_Warning::class, $exception->getPrevious()); $this->assertInstanceOf(Warning::class, $exception->getPrevious()); $this->assertEquals($exception->getMessage(), 'Missing file with ID 9999.'); $this->assertEmpty($entity->image_test->width); $this->assertEmpty($entity->image_test->height); Loading
core/modules/locale/tests/src/Unit/LocaleLookupTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ class LocaleLookupTest extends UnitTestCase { /** * A mocked config factory built with UnitTestCase::getConfigFactoryStub(). * * @var \Drupal\Core\Config\ConfigFactory|\PHPUnit_Framework_MockObject_MockBuilder * @var \Drupal\Core\Config\ConfigFactory|\PHPUnit\Framework\MockObject\MockBuilder */ protected $configFactory; Loading