Skip to content

Commit

Permalink
[TASK] Rename to typo3fluid/schemagenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jan 16, 2016
1 parent bd81a0f commit 0fbec97
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
5 changes: 1 addition & 4 deletions bin/generateschema
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ foreach ($namespaces as $namespace) {
exitWithError(sprintf('Directory "%s" does not exist but is declared in composer autoload entries', $classesPath));
}
}
#var_dump($prefixes);
#var_dump($namespaces);
var_dump($namespaceClassPathMap);
$generator = new \TYPO3\Fluid\SchemaGenerator\SchemaGenerator();
$generator = new \TYPO3Fluid\SchemaGenerator\SchemaGenerator();
$xsd = $generator->generateXsd($namespaceClassPathMap);

echo $xsd;
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "namelesscoder/fluid-schema-generator",
"name": "typo3fluid/schema-generator",
"description": "Generates XSD schemas for packages containing Fluid ViewHelpers",
"license": ["MIT"],
"require": {
Expand All @@ -12,7 +12,7 @@
},
"autoload": {
"psr-4": {
"TYPO3\\Fluid\\SchemaGenerator\\": "src/"
"TYPO3Fluid\\SchemaGenerator\\": "src/"
}
},
"bin": [
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/DocCommentParser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace TYPO3\Fluid\SchemaGenerator;
namespace TYPO3Fluid\SchemaGenerator;

/**
* A little parser which creates tag objects from doc comments
Expand Down
4 changes: 2 additions & 2 deletions src/SchemaGenerator.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace TYPO3\Fluid\SchemaGenerator;
namespace TYPO3Fluid\SchemaGenerator;

use TYPO3\Fluid\Core\ViewHelper\ArgumentDefinition;
use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface;
Expand Down Expand Up @@ -51,7 +51,7 @@ public function generateXsd(array $namespaceClassPathMap) {
foreach ($namespaceClassPathMap as $namespace => $classesPath) {
$classNames = array_replace($classNames, $this->getClassNamesInPackage($classesPath, $namespace));
if (count($classNames) === 0) {
throw new \RuntimeException(sprintf('No ViewHelpers found in path "%s"', $classesPathPath), 1330029328);
throw new \RuntimeException(sprintf('No ViewHelpers found in path "%s"', $classesPath), 1330029328);
}
}
foreach ($classNames as $className) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

/** @var Composer\Autoload\ClassLoader $autoloader */
$autoloader = require __DIR__ . '/../vendor/autoload.php';
$autoloader->addPsr4('TYPO3\\Fluid\\SchemaGenerator\\Tests\\Unit\\', __DIR__ . '/Unit/');
$autoloader->addPsr4('TYPO3Fluid\\SchemaGenerator\\Tests\\Unit\\', __DIR__ . '/Unit/');
10 changes: 4 additions & 6 deletions tests/Functional/SchemaGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
namespace TYPO3\Fluid\SchemaGenerator\Tests\Functional;
use TYPO3\Fluid\SchemaGenerator\SchemaGenerator;
namespace TYPO3Fluid\SchemaGenerator\Tests\Functional;

use TYPO3Fluid\SchemaGenerator\SchemaGenerator;

/**
* Class SchemaGeneratorTest
Expand All @@ -12,10 +13,7 @@ class SchemaGeneratorTest extends \PHPUnit_Framework_TestCase {
*/
public function testGenerateSchema() {
$generator = new SchemaGenerator();
$xml = $generator->generateXsd(
'TYPO3\\Fluid\\ViewHelpers',
__DIR__ . '/../../vendor/namelesscoder/fluid/src/ViewHelpers'
);
$xml = $generator->generateXsd(array('TYPO3Fluid\\Fluid\\ViewHelpers\\' => __DIR__ . '/../../vendor/typo3fluid/fluid/src/ViewHelpers/'));
$this->assertStringStartsWith('<?xml', $xml);
$this->assertStringEndsWith('</xsd:schema>' . PHP_EOL, $xml);
}
Expand Down
11 changes: 6 additions & 5 deletions tests/Unit/SchemaGeneratorTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
namespace TYPO3\Fluid\SchemaGenerator\Tests\Unit;
namespace TYPO3Fluid\SchemaGenerator\Tests\Unit;

use FluidTYPO3\Schemaker\Service\SchemaService;
use TYPO3\Fluid\SchemaGenerator\SchemaGenerator;
use TYPO3Fluid\SchemaGenerator\SchemaGenerator;
use TYPO3Fluid\SchemaGenerator\DocCommentParser;

/**
* Class SchemaGeneratorTest
Expand All @@ -14,7 +15,7 @@ class SchemaGeneratorTest extends \PHPUnit_Framework_TestCase {
*/
public function testPerformsInjections() {
$instance = new SchemaGenerator();
$this->assertAttributeInstanceOf('TYPO3\\Fluid\\SchemaGenerator\\DocCommentParser', 'docCommentParser', $instance);
$this->assertAttributeInstanceOf(DocCommentParser::class, 'docCommentParser', $instance);
}

/**
Expand Down Expand Up @@ -45,10 +46,10 @@ public function getTagNameForClassTestValues() {
* @test
*/
public function testGenerateXsdErrorsWhenNoViewHelpersInPackage() {
$service = $this->getMock('TYPO3\\Fluid\\SchemaGenerator\\SchemaGenerator', array('getClassNamesInPackage'));
$service = $this->getMock(SchemaGenerator::class, array('getClassNamesInPackage'));
$service->expects($this->once())->method('getClassNamesInPackage')->willReturn(array());
$this->setExpectedException('RuntimeException');
$service->generateXsd('FluidTYPO3.Schemaker', 'test');
$service->generateXsd(array('TYPO3Fluid\\SchemaGenerator'));
}

/**
Expand Down

0 comments on commit 0fbec97

Please sign in to comment.