Fixed tests
This commit is contained in:
@@ -11,19 +11,28 @@
|
||||
|
||||
namespace CachetHQ\Tests\Cachet;
|
||||
|
||||
use GrahamCampbell\TestBench\AbstractAppTestCase;
|
||||
use Illuminate\Foundation\Testing\TestCase;
|
||||
|
||||
abstract class AbstractTestCase extends AbstractAppTestCase
|
||||
abstract class AbstractTestCase extends TestCase
|
||||
{
|
||||
/**
|
||||
* Get the service provider class.
|
||||
* The base URL to use while testing the application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Foundation\Application $app
|
||||
*
|
||||
* @return string
|
||||
* @var string
|
||||
*/
|
||||
protected function getServiceProviderClass($app)
|
||||
protected $baseUrl = 'http://localhost';
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
return 'CachetHQ\Cachet\Providers\AppServiceProvider';
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
|
||||
|
||||
return $app;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,18 +21,18 @@ class ComponentTest extends AbstractTestCase
|
||||
public function testGetComponents()
|
||||
{
|
||||
$this->get('/api/v1/components')->seeJson(['data' => []]);
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Illuminate\Database\Eloquent\ModelNotFoundException
|
||||
*/
|
||||
public function testGetInvalidComponent()
|
||||
{
|
||||
$this->get('/api/v1/components/1');
|
||||
$this->assertResponseStatus(404);
|
||||
}
|
||||
|
||||
/*public function testPostComponentUnauthorized()
|
||||
public function testPostComponentUnauthorized()
|
||||
{
|
||||
$this->post('/api/v1/components')->seeJson(['data']);
|
||||
}*/
|
||||
$this->post('/api/v1/components');
|
||||
$this->assertResponseStatus(401);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user