Skip to content

Commit

Permalink
[TASK] Move binaries in bin folder and rename tests folder (TYPO3#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschaufi authored Feb 18, 2020
1 parent 13ac3cf commit a313c3b
Show file tree
Hide file tree
Showing 65 changed files with 74 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
/phpunit.xml.dist export-ignore
/.php_cs.dist export-ignore
/.styleci.yml export-ignore
/Tests export-ignore
/tests export-ignore
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.idea/
phpunit.xml
vendor/
phpunit.xml
.php_cs.cache
.php_cs
# The Api reference is auto generated and should not be part of the repository
/Documentation-GENERATED-temp
sphpdox.phar
_Output/
Documentation/.doctrees
bin/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
php: 7.3
env: PHPUnit
before_script: composer install
script: vendor/bin/phpunit Tests/Unit/
script: vendor/bin/phpunit tests/Unit/
- <<: *phpunit
php: 7.2
- <<: *phpunit
Expand Down
33 changes: 33 additions & 0 deletions bin/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env php
<?php

requireAutoloader();

$app = new \Symfony\Component\Console\Application('TYPO3 Surf', '1.0.0');
$app->add(new \TYPO3\Surf\Command\ReleaseCommand());
$app->setDefaultCommand('release');
$app->run();

function requireAutoloader()
{
$autoloadPaths = [
// Package was included as a library
__DIR__ . '/../../../autoload.php',
// Local package usage
__DIR__ . '/../vendor/autoload.php',
// Local package in packages folder
__DIR__ . '/../../../vendor/autoload.php',
];
foreach ($autoloadPaths as $path) {
if (file_exists($path)) {
/** @noinspection PhpIncludeInspection */
return file_exists($path) && include $path;
}
}

$msg = 'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -sS https://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL;
fwrite(STDERR, $msg);
exit(1);
}
32 changes: 32 additions & 0 deletions bin/surf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env php
<?php

requireAutoloader();

$app = new \TYPO3\Surf\Cli\Symfony\ConsoleApplication('TYPO3 Surf', '3.0.0-alpha');
$app->setFactory(new \TYPO3\Surf\Integration\Factory());
$app->run();

function requireAutoloader()
{
$autoloadPaths = [
// Package was included as a library
__DIR__ . '/../../../autoload.php',
// Local package usage
__DIR__ . '/../vendor/autoload.php',
// Local package in packages folder
__DIR__ . '/../../../vendor/autoload.php',
];
foreach ($autoloadPaths as $path) {
if (file_exists($path)) {
/** @noinspection PhpIncludeInspection */
return file_exists($path) && include $path;
}
}

$msg = 'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -sS https://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL;
fwrite(STDERR, $msg);
exit(1);
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
},
"autoload-dev": {
"psr-4": {
"TYPO3\\Surf\\Tests\\": "Tests"
"TYPO3\\Surf\\Tests\\": "tests"
}
},
"bin": [
"surf"
"bin/surf"
],
"config": {
"platform": {
Expand Down
9 changes: 4 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,19 @@
>
<testsuites>
<testsuite name="Surf Test Suite">
<directory>./Tests/</directory>
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./Resources</directory>
<directory>./Migrations</directory>
<directory>./Documentation</directory>
<directory>./Tests</directory>
<directory>./Resources</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
</phpunit>
15 changes: 0 additions & 15 deletions release

This file was deleted.

14 changes: 0 additions & 14 deletions surf

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a313c3b

Please sign in to comment.