Level 24
Problem solved. Sorry it was completely my bad. I forgot to sign in an employee.
Please see the code below. The getUnconfirmedStudentsCount mocked method doesn't call. My tests are fail.
<?php
use Mockery as m;
use App\Models\Student;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class DashboardStatsTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function an_employee_sees_the_count_of_unconfirmed_students()
{
$this->instance(
'App\Contracts\Repositories\StudentRepository',
$studentRepository = m::mock('App\Contracts\Repositories\StudentRepository')
);
$studentRepository->shouldReceive('getUnconfirmedStudentsCount')->once()->andReturn(10300);
$this->visit('/')->see(10300);
}
}
Please or to participate in this conversation.