diff --git a/composer.json b/composer.json index cb0b96e9..ea851fe5 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,7 @@ { "prefer-stable": true, "require": { - "ext-json": "*", - "php": ">=7.0" + "ext-json": "*" }, "require-dev": { "yoast/phpunit-polyfills": "2.0.0" @@ -20,9 +19,9 @@ "Pimple\\": "src/pimple/pimple/src/Pimple", "Psr\\Container\\": "src/psr/container", "Psr\\SimpleCache\\": "src/psr/simple-cache", - "Symfony\\Component\\Process\\": "src/Symfony/process", - "Symfony\\Component\\EventDispatcher\\": "src/Symfony/event-dispatcher", - "Symfony\\Component\\filesystem\\": "src/Symfony/filesystem", + "Symfony\\Component\\Process\\": "src/symfony/process", + "Symfony\\Component\\EventDispatcher\\": "src/symfony/event-dispatcher", + "Symfony\\Component\\filesystem\\": "src/symfony/filesystem", "Opis\\JsonSchema\\": "src/opis/json-schema/src", "Opis\\String\\": "src/opis/string/src", "Opis\\Uri\\": "src/opis/uri/src" @@ -38,5 +37,8 @@ "classmap": [ "tests/" ] + }, + "scripts": { + "test": [ "Composer\\Config::disableProcessTimeout", "@php ./vendor/phpunit/phpunit/phpunit --testdox" ] } } diff --git a/dev/composer.json b/dev/composer.json index 8fb7fa66..336bf18b 100644 --- a/dev/composer.json +++ b/dev/composer.json @@ -17,9 +17,9 @@ "Pimple\\": "../src/pimple/pimple/src/Pimple", "Psr\\Container\\": "../src/psr/container", "Psr\\SimpleCache\\": "../src/psr/simple-cache", - "Symfony\\Component\\Process\\": "../src/Symfony/process", - "Symfony\\Component\\EventDispatcher\\": "../src/Symfony/event-dispatcher", - "Symfony\\Component\\Filesystem\\": "../src/Symfony/filesystem", + "Symfony\\Component\\Process\\": "../src/symfony/process", + "Symfony\\Component\\EventDispatcher\\": "../src/symfony/event-dispatcher", + "Symfony\\Component\\Filesystem\\": "../src/symfony/filesystem", "Opis\\JsonSchema\\": "../src/opis/json-schema/src", "Opis\\String\\": "../src/opis/string/src", "Opis\\Uri\\": "../src/opis/uri/src" diff --git a/tests/e2e/JsonBlueprintTest.php b/tests/e2e/JsonBlueprintTest.php index 35f9566e..5c33eb72 100644 --- a/tests/e2e/JsonBlueprintTest.php +++ b/tests/e2e/JsonBlueprintTest.php @@ -3,10 +3,6 @@ namespace e2e; use E2ETestCase; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Path; @@ -29,39 +25,27 @@ class JsonBlueprintTest extends E2ETestCase { /** * @before */ - public function before() { - $this->document_root = Path::makeAbsolute( 'test', sys_get_temp_dir() ); + public function before() + { + $this->document_root = Path::makeAbsolute('test', sys_get_temp_dir()); - $this->subscriber = new class() implements EventSubscriberInterface { + $this->subscriber = new class implements EventSubscriberInterface { public static function getSubscribedEvents() { - return array( + return [ ProgressEvent::class => 'onProgress', - DoneEvent::class => 'onDone', - ); + DoneEvent::class => 'onDone', + ]; } protected $progress_bar; - public function __construct() { - ProgressBar::setFormatDefinition( 'custom', ' [%bar%] %current%/%max% -- %message%' ); - - $this->progress_bar = ( new SymfonyStyle( - new StringInput( '' ), - new ConsoleOutput() - ) )->createProgressBar( 100 ); - $this->progress_bar->setFormat( 'custom' ); - $this->progress_bar->setMessage( 'Start' ); - $this->progress_bar->start(); - } + public function __construct() {} public function onProgress( ProgressEvent $event ) { - $this->progress_bar->setMessage( $event->caption ); - $this->progress_bar->setProgress( (int) $event->progress ); + echo $event->caption . " – " . $event->progress . "%\n"; } - public function onDone( DoneEvent $event ) { - $this->progress_bar->finish(); - } + public function onDone( DoneEvent $event ) {} }; } diff --git a/tests/e2e/PhpBlueprintTest.php b/tests/e2e/PhpBlueprintTest.php index d809d098..d0539743 100644 --- a/tests/e2e/PhpBlueprintTest.php +++ b/tests/e2e/PhpBlueprintTest.php @@ -36,36 +36,23 @@ class PhpBlueprintTest extends E2ETestCase { public function before() { $this->document_root = Path::makeAbsolute( 'test', sys_get_temp_dir() ); - $this->subscriber = new class() implements EventSubscriberInterface { + $this->subscriber = new class implements EventSubscriberInterface { public static function getSubscribedEvents() { - return array( + return [ ProgressEvent::class => 'onProgress', - DoneEvent::class => 'onDone', - ); + DoneEvent::class => 'onDone', + ]; } protected $progress_bar; - public function __construct() { - ProgressBar::setFormatDefinition( 'custom', ' [%bar%] %current%/%max% -- %message%' ); - - $this->progress_bar = ( new SymfonyStyle( - new StringInput( '' ), - new ConsoleOutput() - ) )->createProgressBar( 100 ); - $this->progress_bar->setFormat( 'custom' ); - $this->progress_bar->setMessage( 'Start' ); - $this->progress_bar->start(); - } + public function __construct() {} public function onProgress( ProgressEvent $event ) { - $this->progress_bar->setMessage( $event->caption ); - $this->progress_bar->setProgress( (int) $event->progress ); + echo $event->caption . " – " . $event->progress . "%\n"; } - public function onDone( DoneEvent $event ) { - $this->progress_bar->finish(); - } + public function onDone( DoneEvent $event ) {} }; }