public function testIsUserUnique() { $this->resourceMock->expects($this->once())->method('getConnection')->willReturn($this->dbAdapterMock); $this->dbAdapterMock->expects($this->once())->method('select')->willReturn($this->selectMock); $this->selectMock->expects($this->once())->method('from')->willReturn($this->selectMock); $this->selectMock->expects($this->atLeastOnce())->method('where')->willReturn($this->selectMock); $this->dbAdapterMock->expects($this->once())->method('fetchRow')->willReturn([true]); $this->assertFalse($this->model->isUserUnique($this->userMock)); }