From ffd07689c6540d449d0295fffdacd24a79aa3319 Mon Sep 17 00:00:00 2001 From: Florian Weiss Date: Thu, 6 Jul 2023 12:47:42 +0200 Subject: [PATCH] [TASK] Update Unit Tests for new version of PHPUnit, drop Unit Tests that match a specific SVG --- .gitignore | 1 + tests/Unit/Entity/BrandTest.php | 2 +- tests/Unit/Entity/SkillSetTest.php | 2 +- tests/Unit/Entity/SkillTest.php | 2 +- tests/Unit/Verification/LinkTest.php | 194 +-------------------------- 5 files changed, 5 insertions(+), 196 deletions(-) diff --git a/.gitignore b/.gitignore index f7f8ac3..beb7020 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.idea/ /vendor/ +.phpunit.result.cache diff --git a/tests/Unit/Entity/BrandTest.php b/tests/Unit/Entity/BrandTest.php index 429e0fb..05cf341 100644 --- a/tests/Unit/Entity/BrandTest.php +++ b/tests/Unit/Entity/BrandTest.php @@ -40,7 +40,7 @@ class BrandTest extends TestCase */ public function instanceCanNotBeCreatedViaConstructor() { - $this->expectErrorMessage('Call to private SkillDisplay\PHPToolKit\Entity\Brand::__construct() from context \'SkillDisplay\PHPToolKit\Tests\Unit\Entity\BrandTest\''); + $this->expectExceptionMessage('Call to private SkillDisplay\PHPToolKit\Entity\Brand::__construct() from scope SkillDisplay\PHPToolKit\Tests\Unit\Entity\BrandTest'); new Brand(); } diff --git a/tests/Unit/Entity/SkillSetTest.php b/tests/Unit/Entity/SkillSetTest.php index 10abed1..dd97d9d 100644 --- a/tests/Unit/Entity/SkillSetTest.php +++ b/tests/Unit/Entity/SkillSetTest.php @@ -41,7 +41,7 @@ class SkillSetTest extends TestCase */ public function instanceCanNotBeCreatedViaConstructor() { - $this->expectErrorMessage('Call to private SkillDisplay\PHPToolKit\Entity\SkillSet::__construct() from context \'SkillDisplay\PHPToolKit\Tests\Unit\Entity\SkillSetTest\''); + $this->expectExceptionMessage('Call to private SkillDisplay\PHPToolKit\Entity\SkillSet::__construct() from scope SkillDisplay\PHPToolKit\Tests\Unit\Entity\SkillSetTest'); new SkillSet(); } diff --git a/tests/Unit/Entity/SkillTest.php b/tests/Unit/Entity/SkillTest.php index da30117..e8d7918 100644 --- a/tests/Unit/Entity/SkillTest.php +++ b/tests/Unit/Entity/SkillTest.php @@ -41,7 +41,7 @@ class SkillTest extends TestCase */ public function instanceCanNotBeCreatedViaConstructor() { - $this->expectErrorMessage('Call to private SkillDisplay\PHPToolKit\Entity\Skill::__construct() from context \'SkillDisplay\PHPToolKit\Tests\Unit\Entity\SkillTest\''); + $this->expectExceptionMessage('Call to private SkillDisplay\PHPToolKit\Entity\Skill::__construct() from scope SkillDisplay\PHPToolKit\Tests\Unit\Entity\SkillTest'); new Skill(); } diff --git a/tests/Unit/Verification/LinkTest.php b/tests/Unit/Verification/LinkTest.php index 1b3afee..68f2dba 100644 --- a/tests/Unit/Verification/LinkTest.php +++ b/tests/Unit/Verification/LinkTest.php @@ -103,102 +103,6 @@ class LinkTest extends TestCase ); } - /** - * @test - */ - public function canReturnSkillVerificationButtonForEducational() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('education') - ); - } - - /** - * @test - */ - public function canReturnSkillVerificationButtonForBusiness() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('business') - ); - } - - /** - * @test - */ - public function canReturnSkillVerificationButtonForCertification() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('certification') - ); - } - - /** - * @test - */ - public function canReturnSkillVerificationButtonForSelf() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('self') - ); - } - /** * @test */ @@ -262,103 +166,7 @@ class LinkTest extends TestCase $subject->getVerificationLink('self', null, Link::SKILL_SET) ); } - - /** - * @test - */ - public function canReturnSkillSetVerificationButtonForEducational() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('education', null, Link::SKILL_SET) - ); - } - - /** - * @test - */ - public function canReturnSkillSetVerificationButtonForBusiness() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('business', null, Link::SKILL_SET) - ); - } - - /** - * @test - */ - public function canReturnSkillSetVerificationButtonForCertification() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('certification', null, Link::SKILL_SET) - ); - } - - /** - * @test - */ - public function canReturnSkillSetVerificationButtonForSelf() - { - $settings = $this->prophesize(Settings::class); - $settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify'); - - $subject = new Link($settings->reveal(), 10); - - static::assertSame( - implode(PHP_EOL, [ - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ' ', - ]), - $subject->getVerificationButton('self', null, Link::SKILL_SET) - ); - } - + /** * @test */