Example #1
0
 private function givenTheRepositoryContains(array $items)
 {
     $unwrapped = array_map(function (Collaborator $c) {
         return $c->getWrappedObject();
     }, $items);
     $this->repository->getAll()->willReturn(Collection::fromArray($unwrapped));
 }
Example #2
0
 /**
  * @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)));
 }
Example #3
0
 /**
  * @param Script $script
  * @throws Repository\BlockNotFoundException
  * @return Codepoint\Range\Collection
  */
 public function getCodepointsByScript(Script $script)
 {
     return $this->sourceRepository->getCodepointsByScript($script);
 }
Example #4
0
 /**
  * {@inheritDoc}
  */
 public function count()
 {
     $this->logMethodCall(__FUNCTION__);
     return $this->delegate->count();
 }