Skip to content

Commit

Permalink
Tests: refactor folders
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 22, 2022
1 parent ff2b8c0 commit 4d0d362
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -43,7 +43,7 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\Contributte\\Utils\\": "tests/cases/Unit"
"Tests\\": "tests"
}
},
"minimum-stability": "dev",
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Arrays.phpt → tests/Cases/Arrays.phpt
Expand Up @@ -3,7 +3,7 @@
use Contributte\Utils\Arrays;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

test(function (): void {
$array1 = ['a', 'b', 'c', 'd'];
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Config.phpt → tests/Cases/Config.phpt
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Config;
use Tester\Assert;
Expand Down
14 changes: 7 additions & 7 deletions tests/cases/Unit/Csv.phpt → tests/Cases/Csv.phpt
Expand Up @@ -4,7 +4,7 @@
* Test: Csv
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Csv;
use Nette\InvalidStateException;
Expand Down Expand Up @@ -33,7 +33,7 @@ test(function (): void {
2 => 'city',
3 => 'id',
4 => 'x',
], __DIR__ . '/../../fixtures/sample.csv'));
], __DIR__ . '/../Fixtures/sample.csv'));
});

// Complex array matching
Expand Down Expand Up @@ -67,7 +67,7 @@ test(function (): void {
2 => 'city',
3 => 'extra.id',
4 => 'extra.x',
], __DIR__ . '/../../fixtures/sample.csv'));
], __DIR__ . '/../Fixtures/sample.csv'));
});

// Part of simple array matching
Expand All @@ -81,7 +81,7 @@ test(function (): void {
],
], Csv::structural([
4 => 'x',
], __DIR__ . '/../../fixtures/sample.csv'));
], __DIR__ . '/../Fixtures/sample.csv'));
});

// Part of complex array matching
Expand All @@ -103,7 +103,7 @@ test(function (): void {
],
], Csv::structural([
4 => 'x.y.z',
], __DIR__ . '/../../fixtures/sample.csv'));
], __DIR__ . '/../Fixtures/sample.csv'));
});

// Overriding
Expand All @@ -118,7 +118,7 @@ test(function (): void {
], Csv::structural([
2 => 'x',
4 => 'x',
], __DIR__ . '/../../fixtures/sample.csv'));
], __DIR__ . '/../Fixtures/sample.csv'));
});

// Invalid arguments
Expand All @@ -132,6 +132,6 @@ test(function (): void {
4 => 'e',
5 => 'f',
6 => 'g',
], __DIR__ . '/../../fixtures/sample.csv');
], __DIR__ . '/../Fixtures/sample.csv');
}, InvalidStateException::class);
});
Expand Up @@ -11,7 +11,7 @@ use Nette\DI\Container;
use Nette\DI\ContainerLoader;
use Tester\Assert;

require_once __DIR__ . '/../../../bootstrap.php';
require_once __DIR__ . '/../../bootstrap.php';

test(function (): void {
$loader = new ContainerLoader(TEMP_DIR, true);
Expand Down
Expand Up @@ -4,7 +4,7 @@
* Test: DateTime [comparing]
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\DateTime;
use Tester\Assert;
Expand Down
Expand Up @@ -4,7 +4,7 @@
* Test: DateTime
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\DateTime;
use Tester\Assert;
Expand Down
@@ -1,8 +1,8 @@
<?php declare(strict_types = 1);

namespace Tests\Contributte\Utils\Unit;
namespace Tests\Cases;

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Deeper;
use Nette\InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Fields.phpt → tests/Cases/Fields.phpt
Expand Up @@ -4,7 +4,7 @@
* Test: Fields
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Fields;
use Tester\Assert;
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Http.phpt → tests/Cases/Http.phpt
Expand Up @@ -4,7 +4,7 @@
* Test: Http
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Http;
use Tester\Assert;
Expand Down
Expand Up @@ -3,7 +3,7 @@
use Contributte\Utils\LazyCollection;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

test(function (): void {
$data = ['foo', 'bar', 'baz'];
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Merger.phpt → tests/Cases/Merger.phpt
Expand Up @@ -3,7 +3,7 @@
use Contributte\Utils\Merger;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

test(function (): void {
$right = [
Expand Down
@@ -1,6 +1,6 @@
<?php declare(strict_types = 1);

namespace Tests\Contributte\Utils\Unit\Monad;
namespace Tests\Cases\Monad;

use Contributte\Utils\Monad\Optional;
use Exception;
Expand All @@ -9,7 +9,7 @@
use Tester\TestCase;
use Throwable;

require_once __DIR__ . '/../../../bootstrap.php';
require_once __DIR__ . '/../../bootstrap.php';

class OptionalTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Strings.phpt → tests/Cases/Strings.phpt
Expand Up @@ -4,7 +4,7 @@
* Test: Strings
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Strings;
use Tester\Assert;
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/Unit/Urls.phpt → tests/Cases/Urls.phpt
Expand Up @@ -3,7 +3,7 @@
use Contributte\Utils\Urls;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

// Urls::spaceless
test(function (): void {
Expand Down
Expand Up @@ -4,7 +4,7 @@
* Test: Validators
*/

require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../bootstrap.php';

use Contributte\Utils\Validators;
use Tester\Assert;
Expand Down
Expand Up @@ -7,7 +7,7 @@
use Contributte\Utils\Values\Email;
use Tester\Assert;

require_once __DIR__ . '/../../../bootstrap.php';
require_once __DIR__ . '/../../bootstrap.php';

test(function (): void {
$email = new Email('foo@bar.baz');
Expand Down
File renamed without changes.

0 comments on commit 4d0d362

Please sign in to comment.