public function testFindOneReturnsArray() { $collection = 'users'; $query = array('email' => '*****@*****.**'); $options = array(); // the return value from the find $userData = $this->getUserValues(); $this->collectionMock->expects($this->once())->method('findOne')->with($query, $options)->willReturn($userData); $result = $this->connection->findOne($collection, $query, $options); // assertions $this->assertEquals($result['name'], $userData['name']); }