mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 08:40:09 +01:00
adjust tests
This commit is contained in:
31
tests/Drivers/StatamicV2ValetDriverTest.php
Normal file
31
tests/Drivers/StatamicV2ValetDriverTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use Valet\Drivers\Specific\StatamicV2ValetDriver;
|
||||
|
||||
class StatamicV2ValetDriverTest extends BaseDriverTestCase
|
||||
{
|
||||
public function test_it_serves_statamic_projects()
|
||||
{
|
||||
$driver = new StatamicV2ValetDriver();
|
||||
|
||||
$this->assertTrue($driver->serves($this->projectDir('statamicv2'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_doesnt_serve_non_statamic_projects()
|
||||
{
|
||||
$driver = new StatamicV2ValetDriver();
|
||||
|
||||
$this->assertFalse($driver->serves($this->projectDir('public-with-index-non-laravel'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_gets_front_controller()
|
||||
{
|
||||
$driver = new StatamicV2ValetDriver();
|
||||
|
||||
$_SERVER['REQUEST_METHOD'] = 'GET';
|
||||
$_SERVER['REQUEST_URI'] = '/about/';
|
||||
|
||||
$projectPath = $this->projectDir('statamicv2');
|
||||
$this->assertEquals($projectPath.'/index.php', $driver->frontControllerPath($projectPath, 'my-site', '/'));
|
||||
}
|
||||
}
|
||||
@@ -11,21 +11,25 @@ public function test_it_serves_statamic_projects()
|
||||
$this->assertTrue($driver->serves($this->projectDir('statamic'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_doesnt_serve_non_statamic_projects()
|
||||
public function test_it_doesnt_serve_non_statamic_projects_with_public_directory()
|
||||
{
|
||||
$driver = new StatamicValetDriver();
|
||||
|
||||
$this->assertFalse($driver->serves($this->projectDir('public-with-index-non-laravel'), 'my-site', '/'));
|
||||
}
|
||||
|
||||
public function test_it_doesnt_serve_laravel_projects()
|
||||
{
|
||||
$driver = new StatamicValetDriver();
|
||||
|
||||
$this->assertFalse($driver->serves($this->projectDir('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', '/'));
|
||||
$projectPath = $this->projectDir('statamic');
|
||||
$this->assertEquals($projectPath.'/public/index.php', $driver->frontControllerPath($projectPath, 'my-site', '/'));
|
||||
}
|
||||
}
|
||||
|
||||
0
tests/Drivers/projects/statamic/please
Normal file
0
tests/Drivers/projects/statamic/please
Normal file
0
tests/Drivers/projects/statamic/public/index.php
Normal file
0
tests/Drivers/projects/statamic/public/index.php
Normal file
0
tests/Drivers/projects/statamicv2/index.php
Normal file
0
tests/Drivers/projects/statamicv2/index.php
Normal file
0
tests/Drivers/projects/statamicv2/statamic/.gitkeep
Normal file
0
tests/Drivers/projects/statamicv2/statamic/.gitkeep
Normal file
Reference in New Issue
Block a user