aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2017-11-10 10:48:05 +0100
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2017-11-10 10:48:05 +0100
commit751f747172be60246f20ee834367f47d8d5251a8 (patch)
treeb7f535bd7e7be985fe68ce6cd877f5d385f9c900
parent5f4bbb86eb68b9fbf45775de52e9cd72e0d0945e (diff)
downloadTest-751f747172be60246f20ee834367f47d8d5251a8.zip
Test-751f747172be60246f20ee834367f47d8d5251a8.tar.gz
Test-751f747172be60246f20ee834367f47d8d5251a8.tar.bz2
chore(php) Update to PHP 7.
-rw-r--r--.atoum.php2
-rw-r--r--.autoloader.atoum.php4
-rw-r--r--Bin/Clean.php15
-rw-r--r--Bin/Generate.php15
-rw-r--r--Bin/Run.php17
-rw-r--r--Source/Coverage.php (renamed from Coverage.php)5
-rw-r--r--Source/Decorrelated.php (renamed from Decorrelated.php)5
-rw-r--r--Source/Integration/Suite.php (renamed from Integration/Suite.php)7
-rw-r--r--Source/Protocol/Vfs.php (renamed from Protocol/Vfs.php)2
-rw-r--r--Source/Report/Cli/Cli.php (renamed from Report/Cli/Cli.php)3
-rw-r--r--Source/Report/Cli/Colorizer.php (renamed from Report/Cli/Colorizer.php)3
-rw-r--r--Source/Report/Cli/Colors.php (renamed from Report/Cli/Colors.php)17
-rw-r--r--Source/Report/Cli/Fields/Duration.php (renamed from Report/Cli/Fields/Duration.php)3
-rw-r--r--Source/Report/Cli/Fields/Memory.php (renamed from Report/Cli/Fields/Memory.php)3
-rw-r--r--Source/Report/Cli/Fields/Nil.php (renamed from Report/Cli/Fields/Nil.php)5
-rw-r--r--Source/Report/Cli/Fields/Result.php (renamed from Report/Cli/Fields/Result.php)3
-rw-r--r--Source/Report/Cli/Fields/Uncompleted.php (renamed from Report/Cli/Fields/Uncompleted.php)3
-rw-r--r--Source/Unit/Suite.php (renamed from Unit/Suite.php)7
-rw-r--r--composer.json3
19 files changed, 66 insertions, 56 deletions
diff --git a/.atoum.php b/.atoum.php
index 988bf9f..c1782fb 100644
--- a/.atoum.php
+++ b/.atoum.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
use Atoum\PraspelExtension;
use Hoa\Test;
use mageekguy\atoum;
diff --git a/.autoloader.atoum.php b/.autoloader.atoum.php
index 012d081..45db750 100644
--- a/.autoloader.atoum.php
+++ b/.autoloader.atoum.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
date_default_timezone_set('Europe/Paris');
$composerAutoloaders = [
@@ -27,11 +29,13 @@ if (false === defined('HOA')) {
require_once
dirname(__DIR__) . DIRECTORY_SEPARATOR .
'Consistency' . DIRECTORY_SEPARATOR .
+ 'Source' . DIRECTORY_SEPARATOR .
'Prelude.php';
require_once
dirname(__DIR__) . DIRECTORY_SEPARATOR .
'Protocol' . DIRECTORY_SEPARATOR .
+ 'Source' . DIRECTORY_SEPARATOR .
'Wrapper.php';
}
diff --git a/Bin/Clean.php b/Bin/Clean.php
index c63728f..6f3afa1 100644
--- a/Bin/Clean.php
+++ b/Bin/Clean.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/**
* Hoa
@@ -44,7 +44,6 @@ use Hoa\File;
*
* Clean generated tests.
*
- * @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Clean extends Console\Dispatcher\Kit
@@ -68,7 +67,7 @@ class Clean extends Console\Dispatcher\Kit
*
* @return int
*/
- public function main()
+ public function main(): int
{
$libraries = [];
@@ -94,7 +93,7 @@ class Clean extends Console\Dispatcher\Kit
if (empty($libraries)) {
echo 'Already clean.';
- return;
+ return 0;
}
break;
@@ -114,7 +113,7 @@ class Clean extends Console\Dispatcher\Kit
if (empty($libraries)) {
echo 'Already clean.';
- return;
+ return 0;
}
break;
@@ -159,7 +158,7 @@ class Clean extends Console\Dispatcher\Kit
$directory->close();
}
- return;
+ return 0;
}
/**
@@ -167,7 +166,7 @@ class Clean extends Console\Dispatcher\Kit
*
* @return int
*/
- public function usage()
+ public function usage(): int
{
echo
'Usage : test:clean <options>', "\n",
@@ -178,7 +177,7 @@ class Clean extends Console\Dispatcher\Kit
'help' => 'This help.'
]), "\n";
- return;
+ return 0;
}
}
diff --git a/Bin/Generate.php b/Bin/Generate.php
index f77fdc6..234ddae 100644
--- a/Bin/Generate.php
+++ b/Bin/Generate.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/**
* Hoa
@@ -45,7 +45,6 @@ use Hoa\Test;
* Automatically generate test suites based on examples in API documentations
* or from contracts written in Praspel.
*
- * @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Generate extends Console\Dispatcher\Kit
@@ -70,10 +69,10 @@ class Generate extends Console\Dispatcher\Kit
*
* @return int
*/
- public function main()
+ public function main(): int
{
- $directoryToScan = null;
- $namespaceToScan = null;
+ $directoryToScan = null;
+ $namespaceToScan = null;
while (false !== $c = $this->getOption($v)) {
switch ($c) {
@@ -111,7 +110,7 @@ class Generate extends Console\Dispatcher\Kit
return $this->usage();
}
- return;
+ return 0;
}
/**
@@ -119,7 +118,7 @@ class Generate extends Console\Dispatcher\Kit
*
* @return int
*/
- public function usage()
+ public function usage(): int
{
echo
'Usage : test:generate <options>', "\n",
@@ -131,7 +130,7 @@ class Generate extends Console\Dispatcher\Kit
'help' => 'This help.'
]), "\n";
- return;
+ return 0;
}
}
diff --git a/Bin/Run.php b/Bin/Run.php
index 3c8f42e..aa4a5d7 100644
--- a/Bin/Run.php
+++ b/Bin/Run.php
@@ -1,4 +1,4 @@
-<?php
+<?php declare(strict_types=1);
/**
* Hoa
@@ -39,16 +39,15 @@ namespace Hoa\Test\Bin;
use Hoa\Consistency;
use Hoa\Console;
use Hoa\File;
-use Kitab;
use Hoa\Protocol;
use Hoa\Test;
+use Kitab;
/**
* Class Hoa\Test\Bin\Run.
*
* Run tests.
*
- * @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Run extends Console\Dispatcher\Kit
@@ -80,7 +79,7 @@ class Run extends Console\Dispatcher\Kit
*
* @return int
*/
- public function main()
+ public function main(): int
{
$directories = [];
$files = [];
@@ -380,21 +379,21 @@ class Run extends Console\Dispatcher\Kit
$processus->on('input', function ($bucket) {
return false;
});
- $processus->on('output', function ($bucket) {
+ $processus->on('output', function ($bucket): void {
$data = $bucket->getData();
echo $data['line'], "\n";
return;
});
- $processus->on('stop', function ($bucket) {
+ $processus->on('stop', function ($bucket): void {
// Wait atoum to finish its sub-children.
sleep(1);
exit($bucket->getSource()->getExitCode());
});
$processus->run();
- return;
+ return 0;
}
/**
@@ -402,7 +401,7 @@ class Run extends Console\Dispatcher\Kit
*
* @return int
*/
- public function usage()
+ public function usage(): int
{
echo
'Usage : test:run <options>', "\n",
@@ -428,7 +427,7 @@ class Run extends Console\Dispatcher\Kit
' * namespace,', "\n",
' * tags.', "\n";
- return;
+ return 0;
}
}
diff --git a/Coverage.php b/Source/Coverage.php
index 75daa2a..fc72db5 100644
--- a/Coverage.php
+++ b/Source/Coverage.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -43,9 +45,6 @@ use atoum;
*
* Extend the default coverage scorer, but adds the ability to whitelist
* instead of blacklist a namespace.
-
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
class Coverage extends atoum\score\coverage
{
diff --git a/Decorrelated.php b/Source/Decorrelated.php
index 704b1c3..320ca82 100644
--- a/Decorrelated.php
+++ b/Source/Decorrelated.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -41,9 +43,6 @@ namespace Hoa\Test;
*
* Represent a test suite where test cases are decorrelated from the System
* Under Test.
- *
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
interface Decorrelated
{
diff --git a/Integration/Suite.php b/Source/Integration/Suite.php
index 188467b..2481246 100644
--- a/Integration/Suite.php
+++ b/Source/Integration/Suite.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -42,11 +44,8 @@ use Hoa\Test;
* Class \Hoa\Test\Integration\Suite.
*
* Represent an integration test suite.
- *
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
class Suite extends Test\Unit\Suite
{
- const defaultNamespace = '/\\\Test\\\Integration\\\/';
+ public const defaultNamespace = '/\\\Test\\\Integration\\\/';
}
diff --git a/Protocol/Vfs.php b/Source/Protocol/Vfs.php
index 61d41bf..48e0794 100644
--- a/Protocol/Vfs.php
+++ b/Source/Protocol/Vfs.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
diff --git a/Report/Cli/Cli.php b/Source/Report/Cli/Cli.php
index b1440b7..9b8528e 100644
--- a/Report/Cli/Cli.php
+++ b/Source/Report/Cli/Cli.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli;
use atoum;
diff --git a/Report/Cli/Colorizer.php b/Source/Report/Cli/Colorizer.php
index ca34fd7..d1261cc 100644
--- a/Report/Cli/Colorizer.php
+++ b/Source/Report/Cli/Colorizer.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli;
use atoum;
diff --git a/Report/Cli/Colors.php b/Source/Report/Cli/Colors.php
index ceedcf2..9b8c881 100644
--- a/Report/Cli/Colors.php
+++ b/Source/Report/Cli/Colors.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,16 +35,15 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli;
final class Colors
{
- const WHITE = '#FFFFFF';
- const GRAY = '#CCCCCC';
- const BLACK = '#341d44';
- const GREEN = '#6CBE6C';
- const MAGENTA = '#FF0066';
- const YELLOW = '#FFBB2A';
- const BLUE = '#01BBBC';
+ public const WHITE = '#FFFFFF';
+ public const GRAY = '#CCCCCC';
+ public const BLACK = '#341d44';
+ public const GREEN = '#6CBE6C';
+ public const MAGENTA = '#FF0066';
+ public const YELLOW = '#FFBB2A';
+ public const BLUE = '#01BBBC';
}
diff --git a/Report/Cli/Fields/Duration.php b/Source/Report/Cli/Fields/Duration.php
index 5e76074..93ab3bf 100644
--- a/Report/Cli/Fields/Duration.php
+++ b/Source/Report/Cli/Fields/Duration.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli\Fields;
use atoum\report\fields;
diff --git a/Report/Cli/Fields/Memory.php b/Source/Report/Cli/Fields/Memory.php
index 1024187..81be175 100644
--- a/Report/Cli/Fields/Memory.php
+++ b/Source/Report/Cli/Fields/Memory.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli\Fields;
use atoum\report\fields;
diff --git a/Report/Cli/Fields/Nil.php b/Source/Report/Cli/Fields/Nil.php
index 4e9d508..c2091b5 100644
--- a/Report/Cli/Fields/Nil.php
+++ b/Source/Report/Cli/Fields/Nil.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -8,7 +10,7 @@
*
* New BSD License
*
- * Copyright © 2007-2016, Hoa community. All rights reserved.
+ * Copyright © 2007-2017, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli\Fields;
use atoum\report\fields;
diff --git a/Report/Cli/Fields/Result.php b/Source/Report/Cli/Fields/Result.php
index c584dc3..8efc860 100644
--- a/Report/Cli/Fields/Result.php
+++ b/Source/Report/Cli/Fields/Result.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli\Fields;
use atoum\report\fields;
diff --git a/Report/Cli/Fields/Uncompleted.php b/Source/Report/Cli/Fields/Uncompleted.php
index f38ce92..9082fa8 100644
--- a/Report/Cli/Fields/Uncompleted.php
+++ b/Source/Report/Cli/Fields/Uncompleted.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -33,7 +35,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-
namespace Hoa\Test\Report\Cli\Fields;
use atoum\report\fields;
diff --git a/Unit/Suite.php b/Source/Unit/Suite.php
index 286240f..c47e31a 100644
--- a/Unit/Suite.php
+++ b/Source/Unit/Suite.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
/**
* Hoa
*
@@ -44,13 +46,10 @@ use Hoa\Test;
* Class \Hoa\Test\Unit\Suite.
*
* Represent a unit test suite.
- *
- * @copyright Copyright © 2007-2017 Hoa community
- * @license New BSD License
*/
class Suite extends atoum\test
{
- const defaultNamespace = '/\\\Test\\\Unit\\\/';
+ public const defaultNamespace = '/\\\Test\\\Unit\\\/';
diff --git a/composer.json b/composer.json
index dbe4712..ef4683b 100644
--- a/composer.json
+++ b/composer.json
@@ -38,7 +38,8 @@
},
"autoload": {
"psr-4": {
- "Hoa\\Test\\": "."
+ "Hoa\\Test\\" : "Source",
+ "Hoa\\Test\\Bin\\": "Bin"
}
},
"extra": {