Exemple #1
0
 /**
  * @test
  */
 public function it_can_locate_held_characters_by_codepoints()
 {
     $codepoint0 = Codepoint::fromInt(0);
     $codepoint1 = Codepoint::fromInt(1);
     $codepoints = Codepoint\Collection::fromArray([$codepoint0, $codepoint1]);
     $characters = $this->repository->getByCodepoints($codepoints);
     $tally = 0;
     ha::assertThat('characters', $characters, hm::is(hm::anInstanceOf(Character\Collection::class)));
     foreach ($characters as $character) {
         $tally++;
         ha::assertThat('character', $character->getCodepoint(), hm::is(hm::equalTo($codepoint0)));
     }
     ha::assertThat('count', $tally, hm::is(hm::equalTo(1)));
 }
Exemple #2
0
 public function it_can_provide_all_codepoint_assigned_entities_in_a_given_script()
 {
     $characters = Character\Collection::fromArray([]);
     $codepoint = Codepoint::fromInt(1);
     $ranges = Codepoint\Range\Collection::fromArray([$codepoint]);
     $script = Script::fromValue(Script::COMMON);
     $this->repository->getCodepointsByScript($script)->willReturn($ranges);
     $this->repository->getByCodepoints($ranges->expand())->willReturn($characters);
     $this->getByScript($script)->shouldReturn($characters);
 }
Exemple #3
0
 /**
  * @param Codepoint\Collection $codepoints
  * @return Character\Collection|CodepointAssigned[]
  */
 public function getByCodepoints(Codepoint\Collection $codepoints)
 {
     return $this->sourceRepository->getByCodepoints($codepoints);
 }
 /**
  * {@inheritDoc}
  */
 public function getByCodepoints(Codepoint\Collection $codepoints)
 {
     $this->logMethodCall(__FUNCTION__, [$codepoints]);
     return $this->delegate->getByCodepoints($codepoints);
 }