/** * @test */ public function it_displays_characters_residing_in_a_supplied_script() { $repository = new InMemoryRepository(); $codepoint = Codepoint::fromInt(97); $script = Script::fromValue(Script::LATIN); $character = $this->buildCharacterWithCodepoint($codepoint, null, null, $script); $characters = Collection::fromArray([$character]); $repository->addMany($characters); $this->container['repository.test'] = $repository; $this->commandTester->execute(['command' => PropertiesCommand::COMMAND_NAME, '--from' => 'test', 'property-type' => PropertiesCommand::PROPERTY_SCRIPT, 'value' => $script->getValue()]); $output = $this->commandTester->getDisplay(); $statusCode = $this->commandTester->getStatusCode(); ha::assertThat('output', $output, hm::containsString('U+61:')); ha::assertThat('status code', $statusCode, hm::is(hm::identicalTo(0))); }
/** * @test */ public function it_displays_details_for_resolved_characters() { $repository = new InMemoryRepository(); $codepoint = Codepoint::fromInt(163); $character = $this->buildCharacterWithCodepoint($codepoint); $characters = Collection::fromArray([$character]); $repository->addMany($characters); $this->container['repository.test'] = $repository; $this->commandTester->execute(['command' => SearchCommand::COMMAND_NAME, '--from' => 'test', '--enc' => SearchCommand::ENCODING_DECIMAL, 'codepoint' => $codepoint->getValue()]); $output = $this->commandTester->getDisplay(); $statusCode = $this->commandTester->getStatusCode(); ha::assertThat('output', $output, hm::containsString('Character Found')); ha::assertThat('output', $output, hm::containsString('Export: UCD\\Unicode\\Character')); ha::assertThat('output', $output, hm::containsString('UTF-8: £')); ha::assertThat('status code', $statusCode, hm::is(hm::identicalTo(0))); }
/** * @test */ public function it_transfers_characters_from_one_repository_to_another() { $codepoint = Codepoint::fromInt(1); $character = $this->buildCharacterWithCodepoint($codepoint); $characters = Collection::fromArray([$character]); $source = new InMemoryRepository(); $source->addMany($characters); $destination = new InMemoryRepository(); $this->container['repository.test-source'] = $source; $this->container['repository.test-destination'] = $destination; ha::assertThat(count($source), hm::is(hm::identicalTo(1))); ha::assertThat(count($destination), hm::is(hm::identicalTo(0))); $this->commandTester->execute(['command' => RepositoryTransferCommand::COMMAND_NAME, 'from' => 'test-source', 'to' => 'test-destination']); ha::assertThat(count($source), hm::is(hm::identicalTo(1))); ha::assertThat(count($destination), hm::is(hm::identicalTo(1))); $output = $this->commandTester->getDisplay(); $statusCode = $this->commandTester->getStatusCode(); ha::assertThat('output', $output, hm::containsString('Database Generated')); ha::assertThat('status code', $statusCode, hm::is(hm::identicalTo(0))); }