Skip to content

Commit

Permalink
Merge pull request #4772 from putyourlightson/patch-19
Browse files Browse the repository at this point in the history
Testing: fix deprecation warning and error in PhpStorm
  • Loading branch information
angrybrad authored Aug 28, 2019
2 parents 72a3873 + 1755a98 commit e09c5c8
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 26 deletions.
4 changes: 2 additions & 2 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ paths:
data: tests/_data
support: tests/_support
envs: tests/_envs
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
colors: true
memory_limit: 2048M
coverage:
Expand Down Expand Up @@ -65,4 +65,4 @@ groups:
- 'tests/unit/gql'
- 'tests/unit/services/GqlTest'
- 'tests/unit/helpers/GqlHelperTest'
- 'tests/gql/GqlCest'
- 'tests/gql/GqlCest'
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"zendframework/zend-feed": "^2.8.0"
},
"require-dev": {
"codeception/codeception": "^3.0",
"codeception/codeception": "^3.1",
"codeception/mockery-module": "^0.3",
"codeception/phpunit-wrapper": "^7.7",
"codeception/specify": "^0.4",
Expand All @@ -79,7 +79,8 @@
},
"autoload": {
"psr-4": {
"craft\\": "src/"
"craft\\": "src/",
"crafttests\\fixtures\\": "tests/fixtures/"
}
}
}
9 changes: 5 additions & 4 deletions docs/testing/testing-craft/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ This guide can be used for setting up tests for a Craft site & Modules/Plugins.

[[toc]]

## Step 1: Install Codeception 3.x
## Step 1: Install Codeception 3.1 or higher

Follow instruction 1 and 2 Codeception's [website](https://codeception.com/quickstart). Ensure you install
`codeception/codeception` at `3.1`or higher.

Follow instruction 1 and 2 Codeception's [website](https://codeception.com/quickstart)
::: tip
If you are setting up tests for a Craft CMS Site and not a module/plugin,
when running `composer install` on production, add the `--no-dev` flag to avoid
Expand Down Expand Up @@ -49,8 +51,7 @@ paths:
data: tests/_data
support: tests/_support
envs: tests/_envs
settings:
bootstrap: _bootstrap.php
bootstrap: _bootstrap.php
params:
- tests/.env
modules:
Expand Down
4 changes: 4 additions & 0 deletions src/test/TestSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ public static function configureCraft(): bool
Craft::setAlias('@templates', $templatesPath);
Craft::setAlias('@translations', $translationsPath);

// Prevent `headers already sent` error when running tests in PhpStorm
// https://stackoverflow.com/questions/31175636/headers-already-sent-running-unit-tests-in-phpstorm
ob_start ();

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/internal/example-test-suite/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ paths:
data: tests/_data
support: tests/_support
envs: tests/_envs
bootstrap: _bootstrap.php
settings:
bootstrap: _bootstrap.php
params:
- tests/.env
modules:
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/acceptance/_bootstrap.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/functional/_bootstrap.php

This file was deleted.

7 changes: 0 additions & 7 deletions tests/unit/_bootstrap.php

This file was deleted.

0 comments on commit e09c5c8

Please sign in to comment.