X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmedia%2Ftests%2Fsrc%2FKernel%2FMediaCreationTest.php;fp=web%2Fcore%2Fmodules%2Fmedia%2Ftests%2Fsrc%2FKernel%2FMediaCreationTest.php;h=7eac84e49811085405e31002ffc41cd91ab2a5ff;hp=93d43842263a466bb121ca6cd776537736dbf282;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/media/tests/src/Kernel/MediaCreationTest.php b/web/core/modules/media/tests/src/Kernel/MediaCreationTest.php index 93d438422..7eac84e49 100644 --- a/web/core/modules/media/tests/src/Kernel/MediaCreationTest.php +++ b/web/core/modules/media/tests/src/Kernel/MediaCreationTest.php @@ -28,13 +28,13 @@ class MediaCreationTest extends MediaKernelTestBase { $this->container->get('module_installer')->install(['media_test_type']); $test_media_type = $media_type_storage->load('test'); $this->assertInstanceOf(MediaTypeInterface::class, $test_media_type, 'The media type from default configuration has not been created in the database.'); - $this->assertEquals('Test type', $test_media_type->get('label'), 'Could not assure the correct type name.'); - $this->assertEquals('Test type.', $test_media_type->get('description'), 'Could not assure the correct type description.'); - $this->assertEquals('test', $test_media_type->get('source'), 'Could not assure the correct media source.'); + $this->assertSame('Test type', $test_media_type->get('label'), 'Could not assure the correct type name.'); + $this->assertSame('Test type.', $test_media_type->get('description'), 'Could not assure the correct type description.'); + $this->assertSame('test', $test_media_type->get('source'), 'Could not assure the correct media source.'); // Source field is not set on the media source, but it should never // be created automatically when a config is being imported. - $this->assertEquals(['source_field' => '', 'test_config_value' => 'Kakec'], $test_media_type->get('source_configuration'), 'Could not assure the correct media source configuration.'); - $this->assertEquals(['metadata_attribute' => 'field_attribute_config_test'], $test_media_type->get('field_map'), 'Could not assure the correct field map.'); + $this->assertSame(['source_field' => '', 'test_config_value' => 'Kakec'], $test_media_type->get('source_configuration'), 'Could not assure the correct media source configuration.'); + $this->assertSame(['metadata_attribute' => 'field_attribute_config_test'], $test_media_type->get('field_map'), 'Could not assure the correct field map.'); // Check the Media Type access handler behavior. // We grant access to the 'view label' operation to all users having // permission to 'view media'. @@ -72,10 +72,10 @@ class MediaCreationTest extends MediaKernelTestBase { $this->assertNotInstanceOf(MediaInterface::class, Media::load(rand(1000, 9999)), 'Failed asserting a non-existent media.'); $this->assertInstanceOf(MediaInterface::class, Media::load($media->id()), 'The new media item has not been created in the database.'); - $this->assertEquals($this->testMediaType->id(), $media->bundle(), 'The media item was not created with the correct type.'); - $this->assertEquals('Unnamed', $media->getName(), 'The media item was not created with the correct name.'); + $this->assertSame($this->testMediaType->id(), $media->bundle(), 'The media item was not created with the correct type.'); + $this->assertSame('Unnamed', $media->getName(), 'The media item was not created with the correct name.'); $source_field_name = $media->bundle->entity->getSource()->getSourceFieldDefinition($media->bundle->entity)->getName(); - $this->assertEquals('Nation of sheep, ruled by wolves, owned by pigs.', $media->get($source_field_name)->value, 'Source returns incorrect source field value.'); + $this->assertSame('Nation of sheep, ruled by wolves, owned by pigs.', $media->get($source_field_name)->value, 'Source returns incorrect source field value.'); } }