Quality of life improvements all around.
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline failed
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	ci/woodpecker/push/woodpecker Pipeline failed
				
			This commit is contained in:
		
							
								
								
									
										28
									
								
								tests/AppTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								tests/AppTest.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
declare(strict_types=1);
 | 
			
		||||
 | 
			
		||||
namespace App\Tests;
 | 
			
		||||
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
use PHPUnit\Framework\Attributes\CoversClass;
 | 
			
		||||
use Psr\Log\LoggerInterface;
 | 
			
		||||
use App\App;
 | 
			
		||||
 | 
			
		||||
#[CoversClass(App::class)]
 | 
			
		||||
final class AppTest extends \PHPUnit\Framework\TestCase
 | 
			
		||||
{
 | 
			
		||||
    public function testNonexistentConfigFile(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\Exception::class);
 | 
			
		||||
        new App('no_file');
 | 
			
		||||
        $this->fail('Exception was not thrown');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testGoodConfig(): void
 | 
			
		||||
    {
 | 
			
		||||
        $app = new App('config.example.yml');
 | 
			
		||||
        $this->assertEquals('output.log', $app->getConfig('log'));
 | 
			
		||||
        $this->assertInstanceOf(LoggerInterface::class, $app->getLogger());
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user