Ejemplo n.º 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);
 }
Ejemplo n.º 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]);
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 4
0
 /**
  * @return Codepoint\Collection|Codepoint[]
  */
 public function getMappedTo()
 {
     return Codepoint\Collection::fromArray($this->mappedTo);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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([]);
 }
Ejemplo n.º 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]);
 }
Ejemplo n.º 8
0
 /**
  * @return Codepoint\Collection|Codepoint[]
  */
 public function getStandard()
 {
     return Codepoint\Collection::fromArray($this->standard);
 }