Esempio n. 1
0
 /** @test */
 public function it_parses_from_kebabcase()
 {
     $parser = NameParser::parseFromKebabCase('foo-bar-baz');
     $this->assertEquals(['foo', 'bar', 'baz'], $parser->getPieces());
     $parser = NameParser::parseFromKebabCase('foo-Bar-BAZ');
     $this->assertEquals(['foo', 'bar', 'baz'], $parser->getPieces());
     $parser = NameParser::parseFromKebabCase('foo');
     $this->assertEquals(['foo'], $parser->getPieces());
 }
Esempio n. 2
0
 protected function isReadmeEqualWithBootstrappedOne($filesystem, $stubsPath)
 {
     $extensionName = explode('/', $this->composerJson['name'])[1];
     $nameParser = NameParser::parseFromKebabCase($extensionName);
     $exampleReadme = file_get_contents($stubsPath . '/extension/README.md.stub');
     $exampleReadme = str_replace('{nameTc}', $nameParser->getAsTitleCase(), $exampleReadme);
     $exampleReadme = str_replace('{nameKc}', $nameParser->getAsKebabCase(), $exampleReadme);
     $readme = $this->getReadme($filesystem);
     return $readme === $exampleReadme;
 }