/** * 참여 정보 반환 * * @param string $targetId targetId * @param MemberEntityInterface $author user instance * @return array|null */ public function get($targetId, MemberEntityInterface $author) { return $this->repo->find(['targetId' => $targetId, 'userId' => $author->getId(), 'counterName' => $this->name]); }
/** * test find * * @return void */ public function testFind() { $conn = $this->conn; $query = $this->query; $repo = new Repository($conn); $query->shouldReceive('wheres')->andReturn($query); $query->shouldReceive('first')->andReturn(['result']); $result = $repo->find([]); $this->assertEquals(['result'], $result); }