Skip to content

Commit

Permalink
Tests: refactoring, use contributte/tester
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 15, 2023
1 parent d77d499 commit 5109875
Show file tree
Hide file tree
Showing 30 changed files with 49 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Console\Utils;
namespace Contributte\Anabelle\Tests\Cases\Console\Utils;

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

use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Console\Utils\Exception\ParamsValidatorException;
use Contributte\Anabelle\Console\Utils\ParamsValidator;
use Contributte\Anabelle\Http\AuthCredentials;
use Tester\Assert;
use Tester\TestCase;

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

class ParamsValidatorTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro\Index;
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro\Index;

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

use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\Macro\Index\Exception\PartDidNotMatchException;
use Contributte\Anabelle\Markdown\Macro\Index\IndexSection;
use Contributte\Anabelle\Markdown\Macro\MacroIndex;
use Tester\Assert;
use Tester\TestCase;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro\Index;
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro\Index;

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

use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\Macro\Index\Exception\PartDidNotMatchException;
use Contributte\Anabelle\Markdown\Macro\Index\IndexSubTitle;
use Contributte\Anabelle\Markdown\Macro\MacroIndex;
use Tester\Assert;
use Tester\TestCase;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro\Index;
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro\Index;

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

use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\Macro\Index\Exception\PartDidNotMatchException;
use Contributte\Anabelle\Markdown\Macro\Index\IndexTitle;
use Contributte\Anabelle\Markdown\Macro\MacroIndex;
use Tester\Assert;
use Tester\TestCase;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

declare(strict_types=1);
declare(strict_types = 1);

namespace Contributte\Anabelle\Tests\Markdown\Macro;

require_once __DIR__ . '/../../bootstrap.php';
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro;

use Contributte\Anabelle\Markdown\Macro\MacroInclude;
use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\Macro\MacroInclude;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro;

require_once __DIR__ . '/../../bootstrap.php';
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro;

use Contributte\Anabelle\Markdown\Macro\MacroIndex;
use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\Macro\MacroIndex;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro;
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro;

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

use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Markdown\DocuScope;
use Contributte\Anabelle\Markdown\Macro\MacroInlineFileLink;
use Tester\Assert;
use Tester\TestCase;

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

/**
* @testCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

declare(strict_types=1);

namespace Contributte\Anabelle\Tests\Markdown\Macro;
namespace Contributte\Anabelle\Tests\Cases\Markdown\Macro;

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

use Mockery;
use Symfony\Component\Console\Output\OutputInterface;
use Tester\Assert;
use Tester\TestCase;
use Contributte\Anabelle\Console\Utils\Logger;
use Contributte\Anabelle\Http\AuthCredentials;
use Contributte\Anabelle\Markdown\DocuScope;
use Contributte\Anabelle\Markdown\Macro\MacroSection;
use Mockery;
use Symfony\Component\Console\Output\OutputInterface;
use Tester\Assert;
use Tester\TestCase;

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

/**
* @testCase
Expand Down
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.

This file was deleted.

This file was deleted.

19 changes: 8 additions & 11 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
<?php
<?php declare(strict_types = 1);

declare(strict_types=1);
use Contributte\Tester\Environment;

namespace Api\Tests;
if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer update --dev`';
exit(1);
}

use Tester\Environment;
Environment::setup(__DIR__);

require __DIR__ . '/../vendor/autoload.php';

define('TEST_DOCU_DIR', __DIR__ . '/testDir');

Environment::setup();

date_default_timezone_set('Europe/Prague');
define('TEST_DOCU_DIR', __DIR__ . '/Fixtures/testDir');

0 comments on commit 5109875

Please sign in to comment.