forked from AOEpeople/t3deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use nimut testing framework. - Rename tests to be auto discoverable by phpunit. - Fix minor bugs in test extension in Fixtures folder. - Adapt travis and scrutinizer configurations. - Update README to include travis and scrutinizer links.
- Loading branch information
1 parent
ab4c1de
commit 7da262e
Showing
11 changed files
with
103 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Build files | ||
.Build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,80 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
|
||
env: | ||
- TYPO3_VERSION=^7.6 COVERAGE=1 FUNCTIONAL=1 | ||
- TYPO3_VERSION=^6.2 COVERAGE=1 FUNCTIONAL=1 | ||
- TYPO3_VERSION=^7.6 COVERAGE=0 FUNCTIONAL=0 | ||
- TYPO3_VERSION=^8.7 COVERAGE=0 FUNCTIONAL=0 | ||
- TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=0 | ||
|
||
matrix: | ||
exclude: | ||
- env: TYPO3_VERSION=^6.2 | ||
php: 7.0 | ||
- env: TYPO3_VERSION=^6.2 | ||
php: 7.1 | ||
- env: TYPO3_VERSION=^6.2 | ||
- env: TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=0 | ||
php: 5.5 | ||
- env: TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=0 | ||
php: 5.6 | ||
- env: TYPO3_VERSION=^8.7 COVERAGE=0 FUNCTIONAL=0 | ||
php: 5.5 | ||
- env: TYPO3_VERSION=^6.2 | ||
- env: TYPO3_VERSION=^8.7 COVERAGE=0 FUNCTIONAL=0 | ||
php: 5.6 | ||
- env: TYPO3_VERSION=^7.6 | ||
php: 5.3 | ||
include: | ||
- env: TYPO3_VERSION=^7.6 COVERAGE=1 FUNCTIONAL=1 | ||
php: 7.1 | ||
- env: TYPO3_VERSION=^8.7 COVERAGE=0 FUNCTIONAL=1 | ||
php: 7.1 | ||
- env: TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=1 | ||
php: 7.1 | ||
allow_failures: | ||
- env: TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=1 | ||
- env: TYPO3_VERSION=dev-master COVERAGE=0 FUNCTIONAL=0 | ||
- php: 7.2 | ||
|
||
notifications: | ||
email: | ||
# recipients: | ||
# - [email protected] | ||
on_success: never | ||
on_failure: never | ||
|
||
sudo: false | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- parallel | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
- composer self-update | ||
- composer --version | ||
|
||
before_script: | ||
# Installs TYPO3 | ||
- composer require --dev typo3/cms=$TYPO3_VERSION; | ||
- export "TYPO3_PATH_WEB"=$PWD/.Build/Web; | ||
# Restore composer.json | ||
- git checkout composer.json; | ||
- export "TYPO3_PATH_WEB"=$PWD/.Build/Web; | ||
# Locating UnitTests.xml | ||
- export "UNIT_XML"='.Build/vendor/nimut/testing-framework/res/Configuration/UnitTests.xml' | ||
# Location FunctionalTests.xml | ||
- export "FUNCTIONAL_XML"='.Build/vendor/nimut/testing-framework/res/Configuration/FunctionalTests.xml' | ||
|
||
script: | ||
# Execute unit tests | ||
- > | ||
echo "Running unit tests"; | ||
if [[ "$COVERAGE" == "1" ]]; then | ||
.Build/bin/phpunit --coverage-clover=ut-coverage.clover --colors -c Tests/phpunit.xml | ||
.Build/bin/phpunit --whitelist Classes/ --coverage-clover=ut-coverage.clover --colors -c $UNIT_XML Tests/Unit | ||
else | ||
.Build/bin/phpunit --colors -c Tests/phpunit.xml | ||
.Build/bin/phpunit --colors -c $UNIT_XML Tests/Unit | ||
fi | ||
# Execute functional tests, if enabled | ||
|
@@ -60,9 +87,9 @@ script: | |
export typo3DatabasePassword=""; | ||
if [[ "$COVERAGE" == "1" ]]; then | ||
.Build/bin/phpunit --coverage-clover=ft-coverage.clover --colors -c Tests/functional.xml | ||
.Build/bin/phpunit --whitelist Classes/ --coverage-clover=ft-coverage.clover --colors -c $FUNCTIONAL_XML Tests/Functional | ||
else | ||
.Build/bin/phpunit -c Tests/functional.xml | ||
.Build/bin/phpunit --colors -c $FUNCTIONAL_XML Tests/Functional | ||
fi | ||
fi | ||
|
@@ -73,3 +100,7 @@ script: | |
wget https://scrutinizer-ci.com/ocular.phar | ||
find . -wholename '*-coverage.clover' -o -name '*-coverage.clover' | xargs -i php ocular.phar code-coverage:upload --format=php-clover {} | ||
fi | ||
- > | ||
echo "Running php lint"; | ||
find . -name \*.php ! -path "./.Build/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
CREATE TABLE tx_testextension ( | ||
id int(11) NOT NULL auto_increment, | ||
identifier varchar(250) NOT NULL default '', | ||
tag varchar(250) NOT NULL default '', | ||
PRIMARY KEY (`id`), | ||
KEY `cache_id` (`identifier`) | ||
KEY `cache_tag` (`tag`) | ||
id int(11) NOT NULL auto_increment, | ||
identifier varchar(250) NOT NULL default '', | ||
tag varchar(250) NOT NULL default '', | ||
PRIMARY KEY (`id`), | ||
KEY `cache_id` (`identifier`), | ||
KEY `cache_tag` (`tag`) | ||
) ENGINE=InnoDB; | ||
|
||
CREATE TABLE pages ( | ||
tx_testextension_field varchar(64) NOT NULL default '', | ||
alias varchar(33) NOT NULL default '' | ||
tx_testextension_field varchar(64) NOT NULL default '', | ||
alias varchar(33) NOT NULL default '' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
CREATE TABLE pages ( | ||
tx_testextension_field_test varchar(64) NOT NULL default '', | ||
alias varchar(255) NOT NULL default '' | ||
tx_testextension_field_test varchar(64) NOT NULL default '', | ||
alias varchar(255) NOT NULL default '' | ||
); | ||
|
||
CREATE TABLE tx_testextension_test ( | ||
id int(11) NOT NULL auto_increment, | ||
identifier varchar(250) NOT NULL default '', | ||
tag varchar(250) NOT NULL default '', | ||
PRIMARY KEY (`id`), | ||
KEY `cache_id` (`identifier`) | ||
KEY `cache_tag` (`tag`) | ||
id int(11) NOT NULL auto_increment, | ||
identifier varchar(250) NOT NULL default '', | ||
tag varchar(250) NOT NULL default '', | ||
PRIMARY KEY (`id`), | ||
KEY `cache_id` (`identifier`), | ||
KEY `cache_tag` (`tag`) | ||
) ENGINE=InnoDB; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,13 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2016 AOE GmbH <[email protected]> | ||
* (c) 2018 AOE GmbH <[email protected]> | ||
* All rights reserved | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
***************************************************************/ | ||
|
||
use TYPO3\CMS\Core\Tests\FunctionalTestCase; | ||
use Nimut\TestingFramework\TestCase\FunctionalTestCase; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
/** | ||
|
@@ -17,7 +17,7 @@ | |
* @package t3deploy | ||
* @author Oliver Hader <[email protected]> | ||
*/ | ||
class tx_t3deploy_tests_databaseController_testcase extends FunctionalTestCase | ||
class DatabaseControllerTest extends FunctionalTestCase | ||
{ | ||
/** | ||
* @var array | ||
|
@@ -49,7 +49,7 @@ public function setUp() | |
); | ||
|
||
$expectedSchemaServiceMock->expects($this->any())->method('getTablesDefinitionString')->with(true)->willReturn( | ||
file_get_contents(PATH_tx_t3deploy . 'tests/fixtures/testextension/ext_tables_fixture.sql') | ||
file_get_contents(PATH_tx_t3deploy . 'Tests/Fixtures/testextension/ext_tables_fixture.sql') | ||
); | ||
|
||
$this->controller = new tx_t3deploy_databaseController(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,21 +2,21 @@ | |
/*************************************************************** | ||
* Copyright notice | ||
* | ||
* (c) 2016 AOE GmbH <[email protected]> | ||
* (c) 2018 AOE GmbH <[email protected]> | ||
* All rights reserved | ||
* | ||
* This copyright notice MUST APPEAR in all copies of the script! | ||
***************************************************************/ | ||
|
||
use TYPO3\CMS\Core\Tests\UnitTestCase; | ||
use Nimut\TestingFramework\TestCase\UnitTestCase; | ||
|
||
/** | ||
* Test case for class tx_t3deploy_dispatch. | ||
* | ||
* @package t3deploy | ||
* @author Oliver Hader <[email protected]> | ||
*/ | ||
class tx_t3deploy_tests_dispatch_testcase extends UnitTestCase | ||
class DispatchTest extends UnitTestCase | ||
{ | ||
const ClassPrefix = 'tx_t3deploy_'; | ||
const ClassSuffix = 'Controller'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,12 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"typo3/cms-core": ">=7.6.0,<8.7.99" | ||
}, | ||
"require-dev": { | ||
"typo3/cms": "^7.6", | ||
"phpunit/phpunit": "^4.8" | ||
"nimut/testing-framework": "^2.0.0" | ||
}, | ||
"replace": { | ||
"t3deploy": "*" | ||
|