From 29234ce757bf150f3593a745eccf562ebec6bfe1 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 7 Jul 2024 15:37:24 +0200 Subject: [PATCH] Fix up generated tests --- .../framework/tests/Unit/CustomExceptionsTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/framework/tests/Unit/CustomExceptionsTest.php b/packages/framework/tests/Unit/CustomExceptionsTest.php index f2a1bd38b77..fad2c5e664e 100644 --- a/packages/framework/tests/Unit/CustomExceptionsTest.php +++ b/packages/framework/tests/Unit/CustomExceptionsTest.php @@ -192,11 +192,14 @@ public function testInvalidConfigurationExceptionWithCustomMessage() public function testInvalidConfigurationExceptionWithNamespaceAndKey() { - $exception = new InvalidConfigurationException('Invalid configuration.', 'app', 'debug'); + $exception = new InvalidConfigurationException('Invalid configuration.', 'hyde', 'name'); $this->assertSame('Invalid configuration.', $exception->getMessage()); - $this->assertFileExists($exception->file); - $this->assertIsInt($exception->line); + $this->assertFileExists($exception->getFile()); + $this->assertIsInt($exception->getLine()); + + $this->assertStringContainsString('config'.DIRECTORY_SEPARATOR.'hyde.php', $exception->getFile()); + $this->assertGreaterThan(0, $exception->getLine()); } public function testInvalidConfigurationExceptionWithNonExistentNamespace() @@ -213,7 +216,7 @@ public function testInvalidConfigurationExceptionWithNonExistentKey() public function testInvalidConfigurationExceptionFindConfigLine() { - $exception = new class('Invalid configuration.', 'app', 'debug') extends InvalidConfigurationException { + $exception = new class('Invalid configuration.', 'hyde', 'name') extends InvalidConfigurationException { public function exposedFindConfigLine(string $namespace, string $key): array { return $this->findConfigLine($namespace, $key);