mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-10-31 17:29:04 +00:00 
			
		
		
		
	Added UrlTester draft
This commit is contained in:
		
							
								
								
									
										39
									
								
								application/tests/Integration/UrlIntegrationTest.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								application/tests/Integration/UrlIntegrationTest.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Tests\Integration; | ||||
|  | ||||
| use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | ||||
| use Symfony\Component\HttpFoundation\Request; | ||||
|  | ||||
| class UrlIntegrationTest extends KernelTestCase | ||||
| { | ||||
|     public function setUp(): void | ||||
|     { | ||||
|         self::bootKernel(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Tests urls which are in general reachable. | ||||
|      */ | ||||
|     public function testParameterlesGetRoutes200(): void | ||||
|     { | ||||
|         foreach (['/login', '/imprint'] as $url) { | ||||
|             $this->parameterlesGetRouteTest($url, 200); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     public function testParameterlesGetRoutes302(): void | ||||
|     { | ||||
|         foreach (['/logout'] as $url) { | ||||
|             $this->parameterlesGetRouteTest($url, 302); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private function parameterlesGetRouteTest(string $url, int $status) | ||||
|     { | ||||
|         $request = new Request([], [], [], [], [], ['REQUEST_URI' => $url, null]); | ||||
|         $request->setMethod(Request::METHOD_GET); | ||||
|         $response = static::$kernel->handle($request); | ||||
|         $this->assertEquals($status, $response->getStatusCode()); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user