private function givenTheRepositoryContains(array $items) { $unwrapped = array_map(function (Collaborator $c) { return $c->getWrappedObject(); }, $items); $this->repository->getAll()->willReturn(Collection::fromArray($unwrapped)); }
/** * @test */ public function it_can_be_added_to_if_writable() { if (!$this->repository instanceof WritableRepository) { $this->markTestSkipped('Repository is not writable'); } $codepoint = Codepoint::fromInt(1); $addCharacter = $this->buildCharacterWithCodepoint($codepoint); $addCharacters = Character\Collection::fromArray([$addCharacter]); $this->repository->addMany($addCharacters); $character = $this->repository->getByCodepoint($codepoint); ha::assertThat('character', $character, hm::is(hm::equalTo($addCharacter))); ha::assertThat('count', count($this->repository), hm::is(hm::equalTo(2))); }
/** * @param Script $script * @throws Repository\BlockNotFoundException * @return Codepoint\Range\Collection */ public function getCodepointsByScript(Script $script) { return $this->sourceRepository->getCodepointsByScript($script); }
/** * {@inheritDoc} */ public function count() { $this->logMethodCall(__FUNCTION__); return $this->delegate->count(); }