Skip to content

Commit 81cfbc1

Browse files
committed
Update tests
1 parent 305b7f5 commit 81cfbc1

File tree

11 files changed

+40
-61
lines changed

11 files changed

+40
-61
lines changed

tests/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
_helpers/_generated
2-
*SuiteGuy.php
1+
_helpers/*SuiteTester.php
2+
_helpers/_generated/*

tests/fix.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/integration.suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
error_level: "E_ALL"
22

3-
class_name: IntegrationSuiteGuy
3+
class_name: IntegrationSuiteTester
44

55
modules:
66
enabled:

tests/integration/_bootstrap.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
use Arachne\Bootstrap\Configurator;
44
use Arachne\Codeception\Module\Nette;
5-
use Nette\Bridges\Framework\NetteExtension;
65

76
$configurator = new Configurator();
87
$configurator->enableDebugger(__DIR__.'/../_log');
98
$configurator->setTempDirectory(__DIR__.'/../_temp');
109
$configurator->setDebugMode(true);
1110

1211
// Create Dependency Injection container from config.neon file
13-
$section = class_exists(NetteExtension::class) ? 'nette_2.2' : 'nette_2.3';
14-
$configurator->addConfig(__DIR__.'/config/config.neon', $section);
12+
$configurator->addConfig(__DIR__.'/config/config.neon', false);
1513

1614
// Don't use this instance for anything else than console commands!
1715
$container = $configurator->createContainer();

tests/integration/config/config.neon

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
1-
common:
2-
extensions:
3-
codeception: Arachne\Codeception\DI\CodeceptionExtension
4-
5-
services:
6-
routerFactory: Tests\Integration\Classes\RouterFactory
7-
router: @routerFactory::create()
8-
9-
nette_2.2 < common:
10-
extensions:
11-
nette: Nette\Bridges\Framework\NetteExtension
12-
enumag.application: Enumag\Application\DI\ApplicationExtension
13-
14-
nette:
15-
application:
16-
catchExceptions: null
17-
mapping:
18-
*: Tests\Integration\Classes\*Presenter
19-
20-
nette_2.3 < common:
21-
extensions:
22-
nette.application: Nette\Bridges\ApplicationDI\ApplicationExtension
23-
nette.http: Nette\Bridges\HttpDI\HttpExtension
24-
nette.latte: Nette\Bridges\ApplicationDI\LatteExtension
25-
enumag.application: Enumag\Application\DI\ApplicationExtension
26-
27-
nette.application:
28-
catchExceptions: null
29-
mapping:
30-
*: Tests\Integration\Classes\*Presenter
1+
extensions:
2+
codeception: Arachne\Codeception\DI\CodeceptionExtension
3+
nette.application: Nette\Bridges\ApplicationDI\ApplicationExtension
4+
nette.http: Nette\Bridges\HttpDI\HttpExtension
5+
nette.latte: Nette\Bridges\ApplicationDI\LatteExtension
6+
enumag.application: Enumag\Application\DI\ApplicationExtension
7+
8+
services:
9+
routerFactory: Tests\Integration\Fixtures\RouterFactory
10+
router: @routerFactory::create()
11+
12+
nette.application:
13+
catchExceptions: null
14+
mapping:
15+
*: Tests\Integration\Fixtures\*Presenter

tests/integration/src/ApplicationTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@
22

33
namespace Tests\Integration;
44

5-
use Codeception\TestCase\Test;
5+
use Codeception\Test\Unit;
66
use Nette\Application\Application;
77

88
/**
99
* @author Jáchym Toušek <enumag@gmail.com>
1010
*/
11-
class ApplicationTest extends Test
11+
class ApplicationTest extends Unit
1212
{
1313
public function testApplication()
1414
{
15-
$this->assertInstanceOf(Application::class, $this->guy->grabService(Application::class));
15+
$this->assertInstanceOf(Application::class, $this->tester->grabService(Application::class));
1616
}
1717

1818
public function testPage()
1919
{
20-
$this->guy->amOnPage('/article/page');
21-
$this->guy->seeResponseCodeIs(200);
22-
$this->guy->see('headline', 'h1');
20+
$this->tester->amOnPage('/article/page');
21+
$this->tester->seeResponseCodeIs(200);
22+
$this->tester->see('headline', 'h1');
2323
}
2424

2525
public function testLink()
2626
{
27-
$this->guy->amOnPage('/article/link');
28-
$this->guy->seeResponseCodeIs(200);
29-
$this->guy->see('Normal link');
30-
$this->guy->seeLink('Normal link', '/article/page');
27+
$this->tester->amOnPage('/article/link');
28+
$this->tester->seeResponseCodeIs(200);
29+
$this->tester->see('Normal link');
30+
$this->tester->seeLink('Normal link', '/article/page');
3131
}
3232

3333
public function testRedirect()
3434
{
35-
$this->guy->amOnPage('/article/redirect');
36-
$this->guy->seeResponseCodeIs(301);
37-
$this->guy->seeRedirectTo('/article/page');
35+
$this->tester->amOnPage('/article/redirect');
36+
$this->tester->seeResponseCodeIs(301);
37+
$this->tester->seeRedirectTo('/article/page');
3838
}
3939

4040
public function testUnknown()
4141
{
42-
$this->guy->amOnPage('/article/unknown');
43-
$this->guy->seeResponseCodeIs(404);
42+
$this->tester->amOnPage('/article/unknown');
43+
$this->tester->seeResponseCodeIs(404);
4444
}
4545
}

tests/integration/src/DITest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
namespace Tests\Integration;
44

5-
use Codeception\TestCase\Test;
5+
use Codeception\Test\Unit;
66
use Nette\DI\Container;
77

88
/**
99
* @author Jáchym Toušek <enumag@gmail.com>
1010
*/
11-
class DITest extends Test
11+
class DITest extends Unit
1212
{
1313
public function testContainer()
1414
{
15-
$this->assertInstanceOf(Container::class, $this->guy->grabService(Container::class));
15+
$this->assertInstanceOf(Container::class, $this->tester->grabService(Container::class));
1616
}
1717
}

tests/integration/src/Classes/ArticlePresenter.php renamed to tests/integration/src/Fixtures/ArticlePresenter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Integration\Classes;
3+
namespace Tests\Integration\Fixtures;
44

55
use Nette\Application\UI\Presenter;
66

tests/integration/src/Classes/RouterFactory.php renamed to tests/integration/src/Fixtures/RouterFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Tests\Integration\Classes;
3+
namespace Tests\Integration\Fixtures;
44

55
use Nette\Application\IRouter;
66
use Nette\Application\Routers\Route;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<a n:href="Article:page">
2-
Normal link
2+
Normal link
33
</a>

0 commit comments

Comments
 (0)