Skip to content

Commit

Permalink
WIP: Trying to get unit tests / Travis running
Browse files Browse the repository at this point in the history
backported from zf1s/zf1
  • Loading branch information
onlime committed Feb 8, 2021
1 parent a5446c2 commit 30b510e
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 59 deletions.
56 changes: 27 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
language: php

sudo: false

php:
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
jobs:
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: 8.0
allow_failures:
- php: 8.0
fast_finish: true

env: TMPDIR=/tmp
env:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --no-suggest" USE_XDEBUG=false

install:
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then sh ./tests/php52_install_dependencies.sh; fi
- phpenv rehash
cache:
directories:
- $HOME/.composer/cache

services:
- memcached
- mysql
- postgresql

install:
- phpenv rehash
- if [[ "$USE_XDEBUG" == false ]]; then phpenv config-rm xdebug.ini || return 0; fi
- if [[ "$TRAVIS_PHP_VERSION" == 7* ]]; then phpenv config-add tests/php7.travis.ini; fi
- composer install

before_script:
- phpenv config-rm xdebug.ini || return 0
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer self-update; fi
- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]]; then travis_retry composer install --no-interaction --prefer-source --dev; fi

- mysql -e 'create database zftest;'
- psql -c 'create database zftest;' -U postgres

- if [[ "$TRAVIS_PHP_VERSION" != "5.2" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [[ "$TRAVIS_PHP_VERSION" != "7" ]]; then phpenv config-add tests/config.ini; fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.2" ]]; then phpenv config-add tests/php52_config.ini; fi
- if [[ "$TRAVIS_PHP_VERSION" == "7" ]]; then phpenv config-add tests/php7_config.ini; fi

- cp ./tests/TestConfiguration.travis.php ./tests/TestConfiguration.php

script:
- cd tests/
- php runalltests.php

matrix:
allow_failures:
- php: 7
- php: hhvm
- ./vendor/bin/phpunit

# EOF
23 changes: 20 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"require": {
"php": ">=7.0"
"php": ">=7.0",
"ext-ctype": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-ldap": "*",
"ext-mbstring": "*",
"ext-reflection": "*",
"ext-session": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"ext-xml": "*",
"ext-zlib": "*"
},
"autoload": {
"psr-0": {
Expand All @@ -28,13 +40,18 @@
}
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbunit": "1.3.*"
"php-parallel-lint/php-parallel-lint": "1.0.0",
"phpunit/dbunit": "1.3.*",
"zf1s/phpunit": "3.7.39"
},
"archive": {
"exclude": ["/demos", "/documentation", "/tests"]
},
"replace": {
"zendframework/zendframework1": ">=1.12.20"
},
"scripts": {
"lint": "parallel-lint --exclude vendor --exclude tests/Zend/Loader/_files/ParseError.php .",
"test": "phpunit"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
* to enable tests that require ClientLogin authentication. Enter your
* Google login credentials in the EMAIL and PASSWORD properties below.
*
* Edit TestConfiguration.php, not TestConfiguration.php.dist.
* Edit TestConfiguration.php, not TestConfiguration.dist.php.
* Never commit plaintext passwords to the source code repository.
*
* Note: the GData tests currently require that the TZID env variable
Expand Down Expand Up @@ -443,7 +443,7 @@
* If the EXTENDED_COVERAGE property below is false, most of the I18N
* unit tests will not be computed... this speeds tests up to 80 minutes
* when doing reports. *
* Edit TestConfiguration.php, not TestConfiguration.php.dist.
* Edit TestConfiguration.php, not TestConfiguration.dist.php.
*/
defined('TESTS_ZEND_LOCALE_BCMATH_ENABLED') || define('TESTS_ZEND_LOCALE_BCMATH_ENABLED', true);
defined('TESTS_ZEND_I18N_EXTENDED_COVERAGE') || define('TESTS_ZEND_I18N_EXTENDED_COVERAGE', true);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestConfiguration.travis.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
* TESTS_ZEND_CACHE_XCACHE_ENABLED => xcache extension has to be enabled
*/
defined('TESTS_ZEND_CACHE_SQLITE_ENABLED') || define('TESTS_ZEND_CACHE_SQLITE_ENABLED', true);
defined('TESTS_ZEND_CACHE_MEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_MEMCACHED_ENABLED', true);
defined('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED', true);
//defined('TESTS_ZEND_CACHE_MEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_MEMCACHED_ENABLED', true);
//defined('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED', true);

/**
* Zend_Db_Adapter_Pdo_Mysql and Zend_Db_Adapter_Mysqli
Expand Down Expand Up @@ -82,4 +82,4 @@
defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE', 'zftest');


require_once dirname(__FILE__) . '/TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/TestConfiguration.dist.php';
2 changes: 1 addition & 1 deletion tests/TestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
if (is_readable($zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php')) {
require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php';
} else {
require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.php.dist';
require_once $zfCoreTests . DIRECTORY_SEPARATOR . 'TestConfiguration.dist.php';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Feed/Pubsubhubbub/SubscriberHttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Note that $this->_baseuri must point to a directory on a web server
* containing all the files under the _files directory. You should symlink
* or copy these files and set '_baseuri' properly using the constant in
* TestConfiguration.php (based on TestConfiguration.php.dist)
* TestConfiguration.php (based on TestConfiguration.dist.php)
*
* You can also set the proper constant in your test configuration file to
* point to the right place.
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Http/Client/CommonHttpTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCa
{
/**
* The bast URI for this test, containing all files in the _files directory
* Should be set in TestConfiguration.php or TestConfiguration.php.dist
* Should be set in TestConfiguration.php or TestConfiguration.dist.php
*
* @var string
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Http/Client/ProxyAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* In order to run, TESTS_ZEND_HTTP_CLIENT_HTTP_PROXY must point to a working
* proxy server, which can access TESTS_ZEND_HTTP_CLIENT_BASEURI.
*
* See TestConfiguration.php.dist for more information.
* See TestConfiguration.dist.php for more information.
*
* @category Zend
* @package Zend_Http_Client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_SqlAzure_Management_Client */
require_once 'Zend/Service/SqlAzure/Management/Client.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/BlobSessionHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_SessionHandler */
require_once 'Zend/Service/WindowsAzure/SessionHandler.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Blob */
require_once 'Zend/Service/WindowsAzure/Storage/Blob.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/BlobStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Blob */
require_once 'Zend/Service/WindowsAzure/Storage/Blob.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/BlobStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Blob */
require_once 'Zend/Service/WindowsAzure/Storage/Blob.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Credentials_SharedAccessSignature */
require_once 'Zend/Service/WindowsAzure/Credentials/SharedAccessSignature.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Credentials_SharedKeyLite */
require_once 'Zend/Service/WindowsAzure/Credentials/SharedKeyLite.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Credentials_SharedKey */
require_once 'Zend/Service/WindowsAzure/Credentials/SharedKey.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Blob */
require_once 'Zend/Service/WindowsAzure/Storage/Blob.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/DynamicTableEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Table */
require_once 'Zend/Service/WindowsAzure/Storage/Table.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Management_Client */
require_once 'Zend/Service/WindowsAzure/Management/Client.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/QueueStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Queue */
require_once 'Zend/Service/WindowsAzure/Storage/Queue.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/RetryPolicyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract */
require_once 'Zend/Service/WindowsAzure/RetryPolicy/RetryPolicyAbstract.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage */
require_once 'Zend/Service/WindowsAzure/Storage.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/TableEntityQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_TableEntityQuery */
require_once 'Zend/Service/WindowsAzure/Storage/TableEntityQuery.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/TableEntityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_TableEntity */
require_once 'Zend/Service/WindowsAzure/Storage/TableEntity.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_SessionHandler */
require_once 'Zend/Service/WindowsAzure/SessionHandler.php';
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Service/WindowsAzure/TableStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* Test helpers
*/
require_once dirname(__FILE__) . '/../../../TestHelper.php';
require_once dirname(__FILE__) . '/../../../TestConfiguration.php.dist';
require_once dirname(__FILE__) . '/../../../TestConfiguration.dist.php';

/** Zend_Service_WindowsAzure_Storage_Table */
require_once 'Zend/Service/WindowsAzure/Storage/Table.php';
Expand Down
1 change: 1 addition & 0 deletions tests/php7.travis.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extension = memcached.so

0 comments on commit 30b510e

Please sign in to comment.