Krucas\LaravelUserEmailVerification\Test\DatabaseTokenRepositoryTest::testExistsShouldReturnFalseOnNotFound PHP Method

testExistsShouldReturnFalseOnNotFound() public method

    public function testExistsShouldReturnFalseOnNotFound()
    {
        $repository = $this->getRepository($mocks = $this->getMocks());
        $user = $this->getUserMock();
        $user->shouldReceive('getEmailForVerification')->andReturn('mail');
        $mocks['connection']->shouldReceive('table')->andReturn($table = $this->getQueryBuilderMock());
        $table->shouldReceive('where')->once()->with('email', 'mail')->andReturn($query = $this->getQueryBuilderMock());
        $query->shouldReceive('where')->once()->with('token', 'token')->andReturn($entryQuery = $this->getQueryBuilderMock());
        $entryQuery->shouldReceive('first')->andReturnNull();
        $this->assertFalse($repository->exists($user, 'token'));
    }