diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dea6fa6..d72c896 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Github repo ```bash git remote add github \ - https://github.com/antistatique/drupal-factory-lollipop.git + git@github.com:antistatique/drupal-factory-lollipop.git ``` ## 🔧 Prerequisites diff --git a/tests/src/Kernel/FactoryType/FileFactoryTypeTest.php b/tests/src/Kernel/FactoryType/FileFactoryTypeTest.php index f8a1442..67ca38b 100644 --- a/tests/src/Kernel/FactoryType/FileFactoryTypeTest.php +++ b/tests/src/Kernel/FactoryType/FileFactoryTypeTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\factory_lollipop\Kernel\FactoryType; +use Prophecy\PhpUnit\ProphecyTrait; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\File\FileSystemInterface; @@ -15,6 +16,7 @@ */ class FileFactoryTypeTest extends EntityKernelTestBase { + use ProphecyTrait; /** * The Node Factory resolver. * @@ -70,7 +72,7 @@ public function testCreateNotFilePathAttribute(): void { $this->expectExceptionMessageMatches('#^File ".+/core/tests/fixtures/foo" does not exist\.$#'); } else { - $this->expectExceptionMessageRegExp('#^File ".+/core/tests/fixtures/foo" does not exist\.$#'); + $this->expectExceptionMessageMatches('#^File ".+/core/tests/fixtures/foo" does not exist\.$#'); } $this->fileFactoryTypeResolver->create((object) ['path' => $file_path]); } diff --git a/tests/src/Kernel/FactoryType/MediaTypeFactoryTypeTest.php b/tests/src/Kernel/FactoryType/MediaTypeFactoryTypeTest.php index 89d9041..600d433 100644 --- a/tests/src/Kernel/FactoryType/MediaTypeFactoryTypeTest.php +++ b/tests/src/Kernel/FactoryType/MediaTypeFactoryTypeTest.php @@ -93,7 +93,7 @@ public function testCreateNotExistingSource(): void { $this->expectExceptionMessageMatches('#^The "foo" plugin does not exist\. Valid plugin IDs.+$#'); } else { - $this->expectExceptionMessageRegExp('#^The "foo" plugin does not exist\. Valid plugin IDs.+$#'); + $this->expectExceptionMessageMatches('#^The "foo" plugin does not exist\. Valid plugin IDs.+$#'); } $this->mediaTypeFactoryTypeResolver->create((object) [ 'source' => 'foo', diff --git a/tests/src/Unit/FactoryType/FileFactoryTypeTest.php b/tests/src/Unit/FactoryType/FileFactoryTypeTest.php index 031323b..fd8ff51 100644 --- a/tests/src/Unit/FactoryType/FileFactoryTypeTest.php +++ b/tests/src/Unit/FactoryType/FileFactoryTypeTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\factory_lollipop\Unit\Resolver\FactoryType; +use Prophecy\PhpUnit\ProphecyTrait; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ImmutableConfig; use Drupal\Core\File\FileSystemInterface; @@ -15,6 +16,7 @@ */ class FileFactoryTypeTest extends UnitTestCase { + use ProphecyTrait; /** * The File Factory resolver. * diff --git a/tests/src/Unit/FixtureFactoryTest.php b/tests/src/Unit/FixtureFactoryTest.php index 603e92b..86a3ba0 100644 --- a/tests/src/Unit/FixtureFactoryTest.php +++ b/tests/src/Unit/FixtureFactoryTest.php @@ -55,9 +55,7 @@ public function setUp(): void { * @see \Drupal\Tests\factory_lollipop_test\Kernel\VocabularyFactoryTest */ public function testCreate(): void { - $factory_type_foo = $this->getMockBuilder(FactoryTypeInterface::class) - ->disableOriginalConstructor() - ->getMock(); + $factory_type_foo = $this->createMock(FactoryTypeInterface::class); $factory_type_foo ->expects(self::once()) @@ -70,18 +68,14 @@ public function testCreate(): void { ->method('create') ->with(self::equalTo((object) ['default' => 'lorem', 'arg1' => 'bar'])); - $chain_factory_type_resolver = $this->getMockBuilder(ChainFactoryTypeResolver::class) - ->disableOriginalConstructor() - ->getMock(); + $chain_factory_type_resolver = $this->createMock(ChainFactoryTypeResolver::class); $chain_factory_type_resolver ->expects(self::once()) ->method('getResolvers') ->willReturn([$factory_type_foo]); - $chain_factory_resolver = $this->getMockBuilder(ChainFactoryResolver::class) - ->disableOriginalConstructor() - ->getMock(); + $chain_factory_resolver = $this->createMock(ChainFactoryResolver::class); $factory_Lollipop = $this->getMockBuilder(FixtureFactory::class) ->setConstructorArgs([