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