예제 #1
0
 public function it_can_locate_multiple_codepoint_assigned_entities_by_codepoints()
 {
     $characters = Character\Collection::fromArray([]);
     $codepoints = Codepoint\Collection::fromArray([Codepoint::fromInt(1)]);
     $this->repository->getByCodepoints($codepoints)->willReturn($characters);
     $this->getByCodepoints($codepoints)->shouldReturn($characters);
 }
예제 #2
0
 public function it_can_retrieve_characters_by_codepoints(Character $character1, Character $character2)
 {
     $this->givenCharacterHasCodepointWithValue($character1, 1);
     $this->givenCharacterHasCodepointWithValue($character2, 2);
     $this->givenTheRepositoryHasCharacters([$character1, $character2]);
     $this->getByCodepoints(Codepoint\Collection::fromArray([Codepoint::fromInt(1)]))->shouldIterateLike([$character1]);
 }
예제 #3
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)));
 }
예제 #4
0
 /**
  * @return Codepoint\Collection|Codepoint[]
  */
 public function getMappedTo()
 {
     return Codepoint\Collection::fromArray($this->mappedTo);
 }
예제 #5
0
 public function it_delegates_getByCodepoints_calls($repository, Character $character)
 {
     $codepoints = Codepoint\Collection::fromArray([Codepoint::fromInt(1)]);
     $repository->getByCodepoints($codepoints)->willReturn($character);
     $this->getByCodepoints($codepoints)->shouldReturn($character);
 }
예제 #6
0
 public function it_should_always_return_no_results_when_lookup_by_multiple_characters(Character $character)
 {
     $this->givenCharacterHasCodepointWithValue($character, 1);
     $this->givenTheRepositoryHasCharacters([$character]);
     $this->getByCodepoints(Codepoint\Collection::fromArray([Codepoint::fromInt(1)]))->shouldIterateLike([]);
 }
예제 #7
0
 public function it_can_retrieve_characters_by_codepoints($charactersDirectory, Character $character1, Character $character2, PHPRangeFile $file)
 {
     $charactersDirectory->getFileFromValue(Argument::any())->willReturn($file);
     $this->givenFileUnserializesTo($file, [1 => $character1, 2 => $character2]);
     $this->getByCodepoints(Codepoint\Collection::fromArray([Codepoint::fromInt(1)]))->shouldIterateLike([$character1]);
 }
예제 #8
0
 /**
  * @return Codepoint\Collection|Codepoint[]
  */
 public function getStandard()
 {
     return Codepoint\Collection::fromArray($this->standard);
 }