Skip to content

Commit 79dda8c

Browse files
mabarMilan Felix Šulc
authored and
Milan Felix Šulc
committed
Contributte acquisition
1 parent 53fa2d5 commit 79dda8c

40 files changed

+1152
-989
lines changed

.coveralls.yml

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

docs/index.md renamed to .docs/README.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
Documentation
2-
====
1+
# Codeception
32

4-
Arachne/Codeception is here to help you with Integration and [Functional Tests](http://codeception.com/docs/04-FunctionalTests) for your Nette application.
3+
This library is here to help you with Integration and [Functional Tests](http://codeception.com/docs/04-FunctionalTests) for your Nette application.
54

6-
NetteDIModule
7-
----
5+
## Content
6+
7+
- [Usage - How to use it](#usage)
8+
- [DI module - Nette\DI integration](#nettedimodule)
9+
- [Application module - Nette\Application integration](#netteapplicationmodule)
10+
- [Development](#development)
11+
12+
## Usage
13+
14+
### NetteDIModule
815

916
When you want to write an integration test to make sure that some services work well together you need to create the DI container first.
1017

@@ -14,7 +21,7 @@ error_level: "E_ALL"
1421
class_name: IntegrationSuiteTester
1522
modules:
1623
enabled:
17-
- Arachne\Codeception\Module\NetteDIModule:
24+
- Contributte\Codeception\Module\NetteDIModule:
1825
tempDir: ../_temp/integration
1926
configFiles:
2027
- config/config.neon
@@ -39,7 +46,7 @@ services:
3946
use Codeception\Test\Unit;
4047
class MyServiceTest extends Unit
4148
{
42-
public function testMyService()
49+
public function testMyService(): void
4350
{
4451
// Here you can override the configFiles from integration.suite.yml if needed.
4552
// The newContainerForEachTest option is required for this.
@@ -50,47 +57,68 @@ class MyServiceTest extends Unit
5057
```
5158
`useConfigFiles` method takes array of file paths that are either absolute or relative to suite root.
5259

53-
NetteApplicationModule
54-
----
60+
### NetteApplicationModule
5561

5662
In functional tests you want to emulate the HTTP request and run `Nette\Application\Application` to handle it.
5763

58-
Unfortunately Nette framework has some downsides like the fact that Request and Response are registered as services in the DI Container. For this reason the NetteApplicationModule requires `Arachne\Codeception\DI\CodeceptionExtension` to override the default implementations. **Beware that this is meant for the functional tests only. Do NOT register the extension outside of tests.**
64+
Unfortunately Nette framework has some downsides like the fact that Request and Response are registered as services in the DI Container. For this reason the NetteApplicationModule requires `Contributte\Codeception\DI\CodeceptionExtension` to override the default implementations. **Beware that this is meant for the functional tests only. Do NOT register the extension outside of tests.**
5965

6066
```yml
6167
# /tests/functional.suite.yml
6268
error_level: "E_ALL"
6369
class_name: FunctionalSuiteTester
6470
modules:
6571
enabled:
66-
- Arachne\Codeception\Module\NetteApplicationModule
67-
- Arachne\Codeception\Module\NetteDIModule:
72+
- Contributte\Codeception\Module\NetteApplicationModule
73+
- Contributte\Codeception\Module\NetteDIModule:
6874
tempDir: ../_temp/functional
6975
configFiles:
7076
# Your application config file.
7177
- ../../app/config/config.neon
72-
# Additional config file only to add Arachne\Codeception\DI\HttpExtension.
78+
# Additional config file only to add Contributte\Codeception\DI\HttpExtension.
7379
- config/config.neon
7480
```
7581
7682
```yml
7783
# /tests/functional/config/config.neon
7884
extensions:
79-
codeception: Arachne\Codeception\DI\HttpExtension
85+
codeception: Contributte\Codeception\DI\HttpExtension
8086
```
8187
8288
```php
8389
# /tests/functional/src/HomepageTest.php
8490
use Codeception\Test\Unit;
8591
class HomepageTest extends Unit
8692
{
87-
public function testHomepage()
93+
public function testHomepage(): void
8894
{
89-
// Create http request and run Nette\Application\Application. See Arachne\Codeception\Connector\NetteConnector for details.
95+
// Create http request and run Nette\Application\Application. See Contributte\Codeception\Connector\NetteConnector for details.
9096
$this->tester->amOnPage('/');
9197
// Assert that the response is what you expect.
9298
$this->tester->seeResponseCodeIs(200);
9399
$this->tester->see('Hello World!', 'h1');
94100
}
95101
}
96102
```
103+
104+
## Development
105+
106+
Simply run scripts in `composer.json` and make sure that qa, tester and phpstan passed.
107+
108+
### Advanced usage
109+
110+
You can use these commands to do more specific tasks.
111+
112+
```
113+
# generate necessary files to run the tests
114+
./vendor/bin/codecept build
115+
116+
# run all tests
117+
./vendor/bin/codecept run
118+
119+
# run the specific suite
120+
./vendor/bin/codecept run <suite>
121+
122+
# run specific test
123+
./vendor/bin/codecept run <file>
124+
```

.editorconfig

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
13
root = true
24

35
[*]
4-
indent_style = space
5-
indent_size = 4
6-
end_of_line = lf
76
charset = utf-8
8-
trim_trailing_whitespace = true
7+
end_of_line = lf
98
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_style = tab
11+
indent_size = tab
12+
tab_width = 4
13+
14+
[{*.json,*.yml,*.md}]
15+
indent_style = space
16+
indent_size = 2

.gitattributes

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
.coveralls.yml export-ignore
1+
# Not archived
2+
.docs export-ignore
3+
tests export-ignore
24
.editorconfig export-ignore
35
.gitattributes export-ignore
46
.gitignore export-ignore
5-
.php_cs export-ignore
67
.travis.yml export-ignore
78
codeception.yml export-ignore
8-
docs export-ignore
99
phpstan.neon export-ignore
10-
tests export-ignore
11-
*.md export-ignore
10+
README.md export-ignore
11+
ruleset.xml export-ignore

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
# IDE
2+
/.idea
3+
4+
# Composer
15
/vendor
2-
/tests/_log/*
3-
/tests/_temp/*
46
/composer.lock
57

6-
.php_cs.cache
7-
8-
!.gitkeep
8+
# Tests
9+
/temp
10+
/coverage.xml

.php_cs

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

.sensiolabs.yml

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

.travis.yml

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,62 @@
11
language: php
2-
3-
cache:
4-
directories:
5-
- $HOME/.composer/cache
6-
72
php:
8-
- 7.1
9-
- 7.2
10-
- nightly
3+
- 7.1
4+
- 7.2
5+
- 7.3
116

12-
matrix:
13-
fast_finish: true
14-
allow_failures:
15-
- php: nightly
7+
before_install:
8+
# Turn off XDebug
9+
- phpenv config-rm xdebug.ini || return 0
1610

1711
install:
18-
- export PATH="$PATH:$HOME/.composer/vendor/bin"
19-
- composer global require php-coveralls/php-coveralls ^1.0.0
20-
- composer update --no-interaction
21-
22-
before_script:
23-
- if php -v | grep -q 'Xdebug'; then coverage="--coverage-xml"; fi
24-
- vendor/bin/codecept build
12+
# Composer
13+
- travis_retry composer install --no-progress --prefer-dist
2514

2615
script:
27-
- composer validate --strict
28-
- composer outdated --direct --strict
29-
- vendor/bin/php-cs-fixer fix --dry-run
30-
- vendor/bin/phpstan analyse --level=max --configuration=phpstan.neon src tests
31-
- vendor/bin/codecept run $coverage
32-
33-
after_success:
34-
- if [[ ! -z $coverage ]]; then coveralls; fi
16+
# Tests
17+
- composer run-script tests
18+
19+
20+
jobs:
21+
include:
22+
- env: title="Lowest Dependencies 7.1"
23+
php: 7.1
24+
install:
25+
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
26+
script:
27+
- composer run-script tests
28+
29+
- stage: Quality Assurance
30+
php: 7.1
31+
script:
32+
- composer run-script qa
33+
34+
- stage: Phpstan
35+
php: 7.1
36+
script:
37+
- composer run-script phpstan-install
38+
- composer run-script phpstan
39+
40+
- stage: Test Coverage
41+
if: branch = master AND type = push
42+
php: 7.1
43+
script:
44+
- composer run-script coverage
45+
after_script:
46+
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
47+
- php php-coveralls.phar --verbose --config tests/.coveralls.yml
48+
49+
- stage: Outdated Dependencies
50+
if: branch = master AND type = cron
51+
php: 7.1
52+
script:
53+
- composer outdated --direct --strict
54+
55+
allow_failures:
56+
- stage: Test Coverage
57+
58+
sudo: false
59+
60+
cache:
61+
directories:
62+
- $HOME/.composer/cache

license.md renamed to LICENSE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22
====
33

4+
Copyright (c) 2018 Contributte
45
Copyright (c) 2016 Jáchym Toušek ([email protected])
56

67
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Codeception
2+
3+
Integration of Nette Framework to Codeception.
4+
5+
-----
6+
7+
[![Build Status](https://img.shields.io/travis/contributte/codeception.svg?style=flat-square)](https://travis-ci.org/contributte/codeception)
8+
[![Code coverage](https://img.shields.io/coveralls/contributte/codeception.svg?style=flat-square)](https://coveralls.io/r/contributte/codeception)
9+
[![Licence](https://img.shields.io/packagist/l/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
10+
[![Downloads this Month](https://img.shields.io/packagist/dm/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
11+
[![Downloads total](https://img.shields.io/packagist/dt/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
12+
[![Latest stable](https://img.shields.io/packagist/v/contributte/codeception.svg?style=flat-square)](https://packagist.org/packages/contributte/codeception)
13+
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)
14+
15+
## Discussion / Help
16+
17+
[![Join the chat](https://img.shields.io/gitter/room/contributte/contributte.svg?style=flat-square)](http://bit.ly/ctteg)
18+
19+
## Install
20+
21+
```
22+
composer require contributte/codeception
23+
```
24+
25+
## Versions
26+
27+
| State | Version | Branch | PHP | |
28+
|-------------|----------|----------|----------|-----------------|
29+
| dev | `^1.1.0` | `master` | `>= 7.1` | |
30+
| stable | `^1.0.0` | `master` | `>= 7.1` | |
31+
| stable | `^0.8.1` | `master` | `>= 7.1` | (old namespace) |
32+
33+
## Overview
34+
35+
- [Usage - How to use it](/.docs/README.md#usage)
36+
- [DI module - Nette\DI integration](/.docs/README.md#nettedimodule)
37+
- [Application module - Nette\Application integration](/.docs/README.md#netteapplicationmodule)
38+
- [Development](/.docs/README.md#development)
39+
40+
## Maintainers
41+
42+
<table>
43+
<tbody>
44+
<tr>
45+
<td align="center">
46+
<a href="https://github.com/enumag">
47+
<img width="150" height="150" src="https://avatars0.githubusercontent.com/u/539462?s=150&v=4">
48+
</a>
49+
</br>
50+
<a href="https://github.com/enumage">Jáchym Toušek</a>
51+
</td>
52+
<td align="center">
53+
<a href="https://github.com/f3l1x">
54+
<img width="150" height="150" src="https://avatars2.githubusercontent.com/u/538058?v=3&s=150">
55+
</a>
56+
</br>
57+
<a href="https://github.com/f3l1x">Milan Felix Šulc</a>
58+
</td>
59+
</tr>
60+
</tbody>
61+
</table>
62+
63+
-----
64+
65+
Thank you for testing, reporting and contributing.

0 commit comments

Comments
 (0)