From 33340b810505e19a2f3076ec5bf0b887890b7a77 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Tue, 17 Oct 2023 20:34:06 +0300 Subject: [PATCH 1/2] Remove root directory from filename --- src/Traits/InteractsWithScaffolder.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Traits/InteractsWithScaffolder.php b/src/Traits/InteractsWithScaffolder.php index 6775775..65a74ca 100644 --- a/src/Traits/InteractsWithScaffolder.php +++ b/src/Traits/InteractsWithScaffolder.php @@ -24,7 +24,11 @@ public function assertScaffolderCommandSame( $this->assertSame($expected, $data, 'Generated code is not the same with expected.'); if ($expectedFilename) { - $this->assertSame($expectedFilename, $filename, 'Generated filename is not the same with expected.'); + $root = $this->getDirectoryByAlias('root'); + $this->assertSame( + \str_replace($root, '', $expectedFilename), + \str_replace($root, '', $filename), 'Generated filename is not the same with expected.' + ); } return true; @@ -51,7 +55,11 @@ public function assertScaffolderCommandContains( } if ($expectedFilename) { - $this->assertSame($expectedFilename, $filename, 'Generated filename is not the same with expected.'); + $root = $this->getDirectoryByAlias('root'); + $this->assertSame( + \str_replace($root, '', $expectedFilename), + \str_replace($root, '', $filename), 'Generated filename is not the same with expected.' + ); } return true; @@ -69,11 +77,6 @@ public function mockScaffolder(string $command, array $args, \Closure $expected) : null; $files = $this->mockContainer(FilesInterface::class); - $files->shouldReceive('normalizePath')->andReturnUsing(function (string $filename) { - $root = $this->getDirectoryByAlias('root'); - - return \str_replace($root, '', $filename); - }); $files->shouldReceive('exists')->andReturnFalse(); $files->shouldReceive('write')->withArgs($expected); From de652cf2f76e15094280d2fe9acb9b73178af14b Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Tue, 17 Oct 2023 20:42:19 +0300 Subject: [PATCH 2/2] Update Spiral components --- composer.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 6639141..594c6dd 100644 --- a/composer.json +++ b/composer.json @@ -44,21 +44,21 @@ "nyholm/psr7": "^1.5", "mockery/mockery": "^1.5", "phpunit/phpunit": "^9.6 || ^10.0", - "spiral/auth": "^3.7", - "spiral/auth-http": "^3.7", - "spiral/boot": "^3.7", - "spiral/events": "^3.7", - "spiral/console": "^3.7", - "spiral/http": "^3.7", - "spiral/mailer": "^3.7", - "spiral/queue": "^3.7", - "spiral/session": "^3.7", - "spiral/security": "^3.7", - "spiral/tokenizer": "^3.7", - "spiral/storage": "^3.7", - "spiral/views": "^3.7", - "spiral/translator": "^3.7", - "spiral/scaffolder": "^3.7", + "spiral/auth": "^3.8.4", + "spiral/auth-http": "^3.8.4", + "spiral/boot": "^3.8.4", + "spiral/events": "^3.8.4", + "spiral/console": "^3.8.4", + "spiral/http": "^3.8.4", + "spiral/mailer": "^3.8.4", + "spiral/queue": "^3.8.4", + "spiral/session": "^3.8.4", + "spiral/security": "^3.8.4", + "spiral/tokenizer": "^3.8.4", + "spiral/storage": "^3.8.4", + "spiral/views": "^3.8.4", + "spiral/translator": "^3.8.4", + "spiral/scaffolder": "^3.8.4", "symfony/mime": "^6.0" }, "suggest": {