From d13e299022bde5062bce6190967a664b7917b77a Mon Sep 17 00:00:00 2001 From: Khoubza Younes Date: Mon, 30 Jan 2023 23:52:31 +0100 Subject: [PATCH] test: add more envelope tests --- .../Prime/Container/FlasherContainerTest.php | 6 +- tests/Prime/Envelope/EnvelopeTest.php | 101 ------ tests/Prime/Notification/EnvelopeTest.php | 328 ++++++++++++++++++ .../Notification/NotificationBuilderTest.php | 28 +- .../Stamp/CreatedAtStampTest.php | 2 +- .../{Envelope => }/Stamp/HandlerStampTest.php | 2 +- .../{Envelope => }/Stamp/HopsStampTest.php | 2 +- .../Stamp/PriorityStampTest.php | 2 +- .../{Envelope => }/Stamp/UuidStampTest.php | 2 +- tests/Prime/TestCase.php | 12 - 10 files changed, 350 insertions(+), 135 deletions(-) delete mode 100644 tests/Prime/Envelope/EnvelopeTest.php create mode 100644 tests/Prime/Notification/EnvelopeTest.php rename tests/Prime/{Envelope => }/Stamp/CreatedAtStampTest.php (96%) rename tests/Prime/{Envelope => }/Stamp/HandlerStampTest.php (94%) rename tests/Prime/{Envelope => }/Stamp/HopsStampTest.php (94%) rename tests/Prime/{Envelope => }/Stamp/PriorityStampTest.php (96%) rename tests/Prime/{Envelope => }/Stamp/UuidStampTest.php (94%) diff --git a/tests/Prime/Container/FlasherContainerTest.php b/tests/Prime/Container/FlasherContainerTest.php index d097fe36..c12fd27c 100644 --- a/tests/Prime/Container/FlasherContainerTest.php +++ b/tests/Prime/Container/FlasherContainerTest.php @@ -18,7 +18,7 @@ class FlasherContainerTest extends TestCase public function testInit() { $this->setProperty('Flasher\Prime\Container\FlasherContainer', 'instance', null); - $container = $this->mock('Flasher\Prime\Container\ContainerInterface'); + $container = $this->getMockBuilder('Flasher\Prime\Container\ContainerInterface')->getMock(); FlasherContainer::init($container); @@ -34,10 +34,10 @@ class FlasherContainerTest extends TestCase { $this->setProperty('Flasher\Prime\Container\FlasherContainer', 'instance', null); - $container = $this->mock('Flasher\Prime\Container\ContainerInterface'); + $container = $this->getMockBuilder('Flasher\Prime\Container\ContainerInterface')->getMock(); $container ->method('get') - ->willreturn($this->mock('Flasher\Prime\FlasherInterface')); + ->willreturn($this->getMockBuilder('Flasher\Prime\FlasherInterface')->getMock()); FlasherContainer::init($container); diff --git a/tests/Prime/Envelope/EnvelopeTest.php b/tests/Prime/Envelope/EnvelopeTest.php deleted file mode 100644 index 3a46fe3b..00000000 --- a/tests/Prime/Envelope/EnvelopeTest.php +++ /dev/null @@ -1,101 +0,0 @@ - - */ - -namespace Flasher\Tests\Prime\Envelope; - -use Flasher\Prime\Notification\Envelope; -use PHPUnit\Framework\TestCase; - -final class EnvelopeTest extends TestCase -{ - /** - * @return void - */ - public function testConstruct() - { - $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); - - $envelope = new Envelope($notification, array($stamp)); - - $this->assertEquals($notification, $envelope->getNotification()); - $this->assertEquals(array(\get_class($stamp) => $stamp), $envelope->all()); - } - - /** - * @return void - */ - public function testWith() - { - $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp1 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); - $stamp2 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); - - $envelope = new Envelope($notification); - $envelope->with($stamp1, $stamp2); - - $this->assertEquals($notification, $envelope->getNotification()); - $this->assertEquals(array(\get_class($stamp1) => $stamp1, \get_class($stamp2) => $stamp2), $envelope->all()); - } - - /** - * @return void - */ - public function testWrap() - { - $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); - - $envelope = Envelope::wrap($notification, array($stamp)); - - $this->assertEquals($notification, $envelope->getNotification()); - $this->assertEquals(array(\get_class($stamp) => $stamp), $envelope->all()); - } - - /** - * @return void - */ - public function testAll() - { - $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamps = array( - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - ); - - $envelope = new Envelope($notification, $stamps); - - $this->assertEquals($notification, $envelope->getNotification()); - $this->assertEquals(array(\get_class($stamps[0]) => $stamps[3]), $envelope->all()); - } - - /** - * @return void - */ - public function testGet() - { - $notification = $this->getMockBuilder('\Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamps = array( - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), - ); - - $envelope = new Envelope($notification, $stamps); - - $this->assertEquals($notification, $envelope->getNotification()); - - $last = $envelope->get(\get_class($stamps[0])); - - $this->assertEquals($stamps[2], $last); - $this->assertEquals($last, $envelope->get(\get_class($stamps[0]))); - - $this->assertNull($envelope->get('NotFoundStamp')); // @phpstan-ignore-line - } -} diff --git a/tests/Prime/Notification/EnvelopeTest.php b/tests/Prime/Notification/EnvelopeTest.php new file mode 100644 index 00000000..29bd0d7f --- /dev/null +++ b/tests/Prime/Notification/EnvelopeTest.php @@ -0,0 +1,328 @@ + + */ + +namespace Flasher\Tests\Prime\Notification; + +use Flasher\Prime\Notification\Envelope; +use Flasher\Prime\Notification\Notification; +use Flasher\Prime\Stamp\HandlerStamp; +use Flasher\Prime\Stamp\HopsStamp; +use Flasher\Prime\Stamp\PresetStamp; +use Flasher\Tests\Prime\TestCase; + +final class EnvelopeTest extends TestCase +{ + /** + * @return void + */ + public function testConstruct() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + + $envelope = new Envelope($notification, array($stamp)); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamp) => $stamp), $envelope->all()); + } + + /** + * @return void + */ + public function testWrap() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + + $envelope = Envelope::wrap($notification, array($stamp)); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamp) => $stamp), $envelope->all()); + } + + /** + * @return void + */ + public function testWith() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp1 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + $stamp2 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + + $envelope = new Envelope($notification); + $envelope->with($stamp1, $stamp2); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamp1) => $stamp1, \get_class($stamp2) => $stamp2), $envelope->all()); + } + + /** + * @return void + */ + public function testWithStamp() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + + $envelope = new Envelope($notification); + $envelope->withStamp($stamp); + + $this->assertContains($stamp, $envelope->all()); + } + + /** + * @return void + */ + public function testWithout() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp1 = new HopsStamp(2); + $stamp2 = new HandlerStamp('flasher'); + $stamp3 = new PresetStamp('entity_saved'); + + $envelope = new Envelope($notification); + $envelope->with($stamp1, $stamp2, $stamp3); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamp1) => $stamp1, \get_class($stamp2) => $stamp2, \get_class($stamp3) => $stamp3), $envelope->all()); + + $envelope->without($stamp1, $stamp3); + + $this->assertEquals(array(\get_class($stamp2) => $stamp2), $envelope->all()); + } + + /** + * @return void + */ + public function testWithoutStamp() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamp1 = new HopsStamp(2); + $stamp2 = new HandlerStamp('flasher'); + $stamp3 = new PresetStamp('entity_saved'); + + $envelope = new Envelope($notification); + $envelope->with($stamp1, $stamp2, $stamp3); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamp1) => $stamp1, \get_class($stamp2) => $stamp2, \get_class($stamp3) => $stamp3), $envelope->all()); + + $envelope->withoutStamp($stamp1); + + $this->assertEquals(array(\get_class($stamp2) => $stamp2, \get_class($stamp3) => $stamp3), $envelope->all()); + } + + /** + * @return void + */ + public function testGet() + { + $notification = $this->getMockBuilder('\Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamps = array( + new HopsStamp(2), + new HandlerStamp('flasher'), + new PresetStamp('entity_saved'), + ); + + $envelope = new Envelope($notification, $stamps); + + $this->assertEquals($notification, $envelope->getNotification()); + + $last = $envelope->get(\get_class($stamps[0])); + + $this->assertEquals($stamps[0], $last); + $this->assertEquals($last, $envelope->get(\get_class($stamps[0]))); + + $this->assertNull($envelope->get('NotFoundStamp')); // @phpstan-ignore-line + } + + /** + * @return void + */ + public function testAll() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $stamps = array( + new HopsStamp(2), + new HandlerStamp('flasher'), + new PresetStamp('entity_saved'), + ); + + $envelope = new Envelope($notification, $stamps); + + $this->assertEquals($notification, $envelope->getNotification()); + $this->assertEquals(array(\get_class($stamps[0]) => $stamps[0], \get_class($stamps[1]) => $stamps[1], \get_class($stamps[2]) => $stamps[2]), $envelope->all()); + } + + /** + * @return void + */ + public function testGetNotification() + { + $notification = new Notification(); + + $envelope = new Envelope($notification); + + $this->assertEquals($notification, $envelope->getNotification()); + } + + /** + * @return void + */ + public function testGetType() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('getType')->willReturn('success'); + + $envelope = new Envelope($notification); + + $this->assertEquals('success', $envelope->getType()); + } + + /** + * @return void + */ + public function testSetType() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('setType'); + + $envelope = new Envelope($notification); + $envelope->setType('success'); + } + + /** + * @return void + */ + public function testGetMessage() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('getMessage')->willReturn('success message'); + + $envelope = new Envelope($notification); + + $this->assertEquals('success message', $envelope->getMessage()); + } + + /** + * @return void + */ + public function testSetMessage() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('setMessage'); + + $envelope = new Envelope($notification); + $envelope->setMessage('success message'); + } + + /** + * @return void + */ + public function testGetTitle() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('getTitle')->willReturn('success title'); + + $envelope = new Envelope($notification); + + $this->assertEquals('success title', $envelope->getTitle()); + } + + /** + * @return void + */ + public function testSetTitle() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('setTitle'); + + $envelope = new Envelope($notification); + $envelope->setTitle('success title'); + } + + /** + * @return void + */ + public function testGetOptions() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('getOptions')->willReturn(array('timeout' => 2500)); + + $envelope = new Envelope($notification); + + $this->assertEquals(array('timeout' => 2500), $envelope->getOptions()); + } + + /** + * @return void + */ + public function testSetOptions() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('setOptions'); + + $envelope = new Envelope($notification); + $envelope->setOptions(array('timeout' => 2500)); + } + + /** + * @return void + */ + public function testGetOption() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('getOption')->willReturn(2500); + + $envelope = new Envelope($notification); + + $this->assertEquals(2500, $envelope->getOption('timeout')); + } + + /** + * @return void + */ + public function testSetOption() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('setOption'); + + $envelope = new Envelope($notification); + $envelope->setOption('timeout', 2500); + } + + /** + * @return void + */ + public function testUnsetOption() + { + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('unsetOption'); + + $envelope = new Envelope($notification); + $envelope->unsetOption('timeout'); + } + + /** + * @return void + */ + public function testToArray() + { + $array = array( + 'title' => 'PHPFlasher', + 'message' => 'success message', + 'options' => array('timeout' => 2500), + ); + + $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); + $notification->expects($this->once())->method('toArray')->willReturn($array); + + $envelope = new Envelope($notification); + + $this->assertEquals(array('notification' => $array), $envelope->toArray()); + } +} diff --git a/tests/Prime/Notification/NotificationBuilderTest.php b/tests/Prime/Notification/NotificationBuilderTest.php index 21bab1a0..2e5e5b7b 100644 --- a/tests/Prime/Notification/NotificationBuilderTest.php +++ b/tests/Prime/Notification/NotificationBuilderTest.php @@ -24,7 +24,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddSuccessMessage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -41,7 +41,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddErrorMessage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -58,7 +58,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddWarningMessage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -75,7 +75,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddInfoMessage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -92,7 +92,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddFlashMessage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -109,7 +109,7 @@ class NotificationBuilderTest extends TestCase */ public function testPushToStorage() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -359,7 +359,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddPreset() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -378,7 +378,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddOperation() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -397,7 +397,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddCreated() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -416,7 +416,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddUpdated() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -435,7 +435,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddSaved() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -454,7 +454,7 @@ class NotificationBuilderTest extends TestCase */ public function testAddDeleted() { - $storageManager = $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); $storageManager->expects($this->once())->method('add'); $builder = $this->getNotificationBuilder($storageManager); @@ -588,7 +588,7 @@ class NotificationBuilderTest extends TestCase { $builder = $this->getNotificationBuilder(); - $stamp = $this->mock('Flasher\Prime\Stamp\StampInterface'); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); $builder->withStamp($stamp); $envelope = $builder->getEnvelope(); @@ -655,7 +655,7 @@ class NotificationBuilderTest extends TestCase private function getNotificationBuilder(StorageManagerInterface $storageManager = null) { /** @var StorageManagerInterface $storageManager */ - $storageManager = $storageManager ?: $this->mock('Flasher\Prime\Storage\StorageManagerInterface'); + $storageManager = $storageManager ?: $this->getMockBuilder('Flasher\Prime\Storage\StorageManagerInterface')->getMock(); return new NotificationBuilder($storageManager, new Notification()); } diff --git a/tests/Prime/Envelope/Stamp/CreatedAtStampTest.php b/tests/Prime/Stamp/CreatedAtStampTest.php similarity index 96% rename from tests/Prime/Envelope/Stamp/CreatedAtStampTest.php rename to tests/Prime/Stamp/CreatedAtStampTest.php index 38bae6ae..b6481dd0 100644 --- a/tests/Prime/Envelope/Stamp/CreatedAtStampTest.php +++ b/tests/Prime/Stamp/CreatedAtStampTest.php @@ -5,7 +5,7 @@ * (c) Younes KHOUBZA */ -namespace Flasher\Tests\Prime\Envelope\Stamp; +namespace Flasher\Tests\Prime\Stamp; use Flasher\Prime\Notification\Envelope; use Flasher\Prime\Stamp\CreatedAtStamp; diff --git a/tests/Prime/Envelope/Stamp/HandlerStampTest.php b/tests/Prime/Stamp/HandlerStampTest.php similarity index 94% rename from tests/Prime/Envelope/Stamp/HandlerStampTest.php rename to tests/Prime/Stamp/HandlerStampTest.php index 4fb9820b..a343e23f 100644 --- a/tests/Prime/Envelope/Stamp/HandlerStampTest.php +++ b/tests/Prime/Stamp/HandlerStampTest.php @@ -5,7 +5,7 @@ * (c) Younes KHOUBZA */ -namespace Flasher\Tests\Prime\Envelope\Stamp; +namespace Flasher\Tests\Prime\Stamp; use Flasher\Prime\Notification\Envelope; use Flasher\Prime\Stamp\HandlerStamp; diff --git a/tests/Prime/Envelope/Stamp/HopsStampTest.php b/tests/Prime/Stamp/HopsStampTest.php similarity index 94% rename from tests/Prime/Envelope/Stamp/HopsStampTest.php rename to tests/Prime/Stamp/HopsStampTest.php index a10fe3b1..42a3448c 100644 --- a/tests/Prime/Envelope/Stamp/HopsStampTest.php +++ b/tests/Prime/Stamp/HopsStampTest.php @@ -5,7 +5,7 @@ * (c) Younes KHOUBZA */ -namespace Flasher\Tests\Prime\Envelope\Stamp; +namespace Flasher\Tests\Prime\Stamp; use Flasher\Prime\Notification\Envelope; use Flasher\Prime\Stamp\HopsStamp; diff --git a/tests/Prime/Envelope/Stamp/PriorityStampTest.php b/tests/Prime/Stamp/PriorityStampTest.php similarity index 96% rename from tests/Prime/Envelope/Stamp/PriorityStampTest.php rename to tests/Prime/Stamp/PriorityStampTest.php index 52dd658a..23442b62 100644 --- a/tests/Prime/Envelope/Stamp/PriorityStampTest.php +++ b/tests/Prime/Stamp/PriorityStampTest.php @@ -5,7 +5,7 @@ * (c) Younes KHOUBZA */ -namespace Flasher\Tests\Prime\Envelope\Stamp; +namespace Flasher\Tests\Prime\Stamp; use Flasher\Prime\Notification\Envelope; use Flasher\Prime\Stamp\HopsStamp; diff --git a/tests/Prime/Envelope/Stamp/UuidStampTest.php b/tests/Prime/Stamp/UuidStampTest.php similarity index 94% rename from tests/Prime/Envelope/Stamp/UuidStampTest.php rename to tests/Prime/Stamp/UuidStampTest.php index dba711f1..a7d64e21 100644 --- a/tests/Prime/Envelope/Stamp/UuidStampTest.php +++ b/tests/Prime/Stamp/UuidStampTest.php @@ -5,7 +5,7 @@ * (c) Younes KHOUBZA */ -namespace Flasher\Tests\Prime\Envelope\Stamp; +namespace Flasher\Tests\Prime\Stamp; use Flasher\Prime\Notification\Envelope; use Flasher\Prime\Stamp\UuidStamp; diff --git a/tests/Prime/TestCase.php b/tests/Prime/TestCase.php index c0734145..0f286c2f 100644 --- a/tests/Prime/TestCase.php +++ b/tests/Prime/TestCase.php @@ -7,8 +7,6 @@ namespace Flasher\Tests\Prime; -use PHPUnit\Framework\MockObject\MockObject; - class TestCase extends \PHPUnit\Framework\TestCase { /** @@ -101,14 +99,4 @@ class TestCase extends \PHPUnit\Framework\TestCase $object = is_string($object) ? null : $object; $property->setValue($object, $value); } - - /** - * @param string $className - * - * @return MockObject - */ - protected function mock($className) - { - return $this->getMockBuilder($className)->getMock(); - } }