Cachet is now a Laravel 5 app

This commit is contained in:
Joseph Cohen
2015-03-20 18:30:45 -06:00
parent 7cfa158e68
commit b4ac66d727
338 changed files with 4164 additions and 4114 deletions

View File

@@ -1,35 +0,0 @@
<?php
class ComponentControllerTest extends TestCase
{
public function setUp()
{
$this->repo = Mockery::mock('CachetHQ\Cachet\Repositories\Component\ComponentRepository');
$this->dingo = Mockery::mock('Dingo\Api\Auth\Shield');
}
public function tearDown()
{
Mockery::close();
}
public function test_get_components_method()
{
$this->repo->shouldReceive('all')->once()->andReturn('foo');
$controller = new CachetHQ\Cachet\Http\Controllers\Api\ComponentController($this->repo);
$response = $controller->getComponents();
$this->assertEquals('foo', $response);
}
public function test_get_component_method()
{
$this->repo->shouldReceive('findOrFail')->with(1)->once()->andReturn('foo');
$controller = new CachetHQ\Cachet\Http\Controllers\Api\ComponentController($this->repo);
$response = $controller->getComponent(1);
$this->assertEquals('foo', $response);
}
}

17
tests/ExampleTest.php Normal file
View File

@@ -0,0 +1,17 @@
<?php
class ExampleTest extends TestCase {
/**
* A basic functional test example.
*
* @return void
*/
public function testBasicExample()
{
$response = $this->call('GET', '/');
$this->assertEquals(200, $response->getStatusCode());
}
}

View File

@@ -1,18 +1,19 @@
<?php
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
/**
* Creates the application.
*
* @return \Symfony\Component\HttpKernel\HttpKernelInterface
*/
public function createApplication()
{
$unitTesting = true;
class TestCase extends Illuminate\Foundation\Testing\TestCase {
$testEnvironment = 'testing';
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
return $app;
}
return require __DIR__.'/../bootstrap/start.php';
}
}