Some attempts at code coverage and coveralls support.

This commit is contained in:
James Cole
2014-07-02 23:12:31 +02:00
parent e03e6e7290
commit 4540e93a63
8 changed files with 362 additions and 20 deletions

View File

@@ -0,0 +1,40 @@
<?php
class UserControllerTest extends TestCase
{
public function setUp()
{
parent::setUp();
$this->mock = $this->mock('Firefly\Storage\User\UserRepositoryInterface');
}
public function mock($class)
{
$mock = Mockery::mock($class);
$this->app->instance($class, $mock);
return $mock;
}
public function testLogin()
{
View::shouldReceive('make')->with('user.login');
$this->call('GET', '/login');
}
public function testPostLogin()
{
$data = ['email' => 'bla@bla.nl', 'password' => 'xxxx','remember_me' => '1'];
Auth::shouldReceive('attempt')->once()->andReturn(true);
$this->call('POST', '/login', $data);
}
public function tearDown()
{
Mockery::close();
}
}