我开箱即可安装Laravel 4。我使用PHP 5.5运行Windows 8 64位,通过XAMPP运行Apache 2.2。
当我运行phpunit
时,我会看到标准的laravel错误页面Whoops, looks like something went wrong.
,就在它上方,我看到PHPUnit 3.8-dev by Sebastian Bergmann. Configuration read from C:\project\phpunit.xml The Xdebug extension is not loaded. No code coverage will be generated.
如果我删除了文件app/tests/ExampleTest.php
,那么phpunit
似乎可以正常工作,而我
PHPUnit 3.8-dev by Sebastian Bergmann.
Configuration read from C:\project\phpunit.xml
The Xdebug extension is not loaded. No code coverage will be generated.
Time: 232 ms, Memory: 2.75Mb
←[30;43mNo tests executed!←[0m
应用程序/测试/ ExampleTest.php
<?php
class ExampleTest extends TestCase {
/**
* A basic functional test example.
*
* @return void
*/
public function testBasicExample()
{
$crawler = $this->client->request('GET', '/');
$this->assertTrue($this->client->getResponse()->isOk());
}
}
应用程序/测试/ TestCase.php
<?php
class TestCase extends Illuminate\Foundation\Testing\TestCase {
/**
* Creates the application.
*
* @return Symfony\Component\HttpKernel\HttpKernelInterface
*/
public function createApplication()
{
$unitTesting = true;
$testEnvironment = 'testing';
return require __DIR__.'/../../bootstrap/start.php';
}
}