mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 08:40:09 +01:00
Move all drivers to PSR autoload, and write tests
This commit is contained in:
31
tests/Drivers/StatamicValetDriverTest.php
Normal file
31
tests/Drivers/StatamicValetDriverTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Valet\Drivers\StatamicValetDriver;
|
||||
|
||||
class StatamicValetDriverTest extends BaseDriverTestCase
|
||||
{
|
||||
public function test_it_serves_statamic_projects()
|
||||
{
|
||||
$driver = new StatamicValetDriver();
|
||||
|
||||
$this->assertTrue($driver->serves($this->projectDir('statamic'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_doesnt_serve_non_statamic_projects()
|
||||
{
|
||||
$driver = new StatamicValetDriver();
|
||||
|
||||
$this->assertFalse($driver->serves($this->projectDir('public-with-index-non-laravel'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_gets_front_controller()
|
||||
{
|
||||
$driver = new StatamicValetDriver();
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_SERVER['REQUEST_URI'] = '/about/';
|
||||
|
||||
$projectPath = $this->projectDir('statamicv1');
|
||||
$this->assertEquals($projectPath.'/index.php', $driver->frontControllerPath($projectPath, 'my-site', '/'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user