/** * @test */ public function it_displays_an_error_for_unresolved_characters() { $this->container['repository.test'] = new InMemoryRepository(); $this->commandTester->execute(['command' => SearchCommand::COMMAND_NAME, '--from' => 'test', 'codepoint' => '1']); $output = $this->commandTester->getDisplay(); $statusCode = $this->commandTester->getStatusCode(); ha::assertThat('output', $output, hm::containsString('Character Not Found')); ha::assertThat('status code', $statusCode, hm::is(hm::identicalTo(1))); }
/** * @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_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))); }
/** * @test */ public function it_provides_a_count_of_held_characters() { $count = count($this->repository); ha::assertThat('count', $count, hm::is(hm::identicalTo(1))); }
/** * @Then /^The Consumer "([^"]*)" has been called once with message "([^"]*)"$/ */ public function theConsumerHasBeenCalledOnceWithMessage($consumerId, $message) { $consumerCalls = $this->getContainer()->get($consumerId)->getCallback()[0]->getExecuteCalls(); ha::assertThat(count($consumerCalls), hm::is(hm::identicalTo(1))); ha::assertThat($message, hm::is(hm::identicalTo($consumerCalls[0]->body))); }