Skip to content

Commit

Permalink
using Nette Tester
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 12, 2012
1 parent 5d07473 commit 8d80012
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 1,548 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/vendor
/composer.lock
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -15,6 +15,10 @@ before_script:
- tar xzf memcached-1.4.14.tar.gz
- sh -c "cd memcached-1.4.14 && ./configure && make && ./memcached -d" > /dev/null

# Install Nette Tester
- curl -s http://getcomposer.org/installer | php
- php composer.phar install --dev

# PHP Memcache extension
- echo n | pecl install memcache > /dev/null

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Expand Up @@ -18,6 +18,9 @@
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"nette/tester": "@dev"
},
"autoload": {
"files": ["Nette/loader.php"]
},
Expand Down
19 changes: 2 additions & 17 deletions tests/Nette/bootstrap.php
Expand Up @@ -7,16 +7,12 @@
* @package Nette\Test
*/

require __DIR__ . '/../Test/TestHelpers.php';
require __DIR__ . '/../Test/Assert.php';

require __DIR__ . '/../../vendor/nette/tester/Tester/bootstrap.php';
require __DIR__ . '/../../Nette/loader.php';


// configure environment
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', TRUE);
ini_set('html_errors', FALSE);
ini_set('log_errors', FALSE);
date_default_timezone_set('Europe/Prague');


Expand All @@ -35,17 +31,6 @@
TestHelpers::purge(TEMP_DIR);


// catch unexpected errors/warnings/notices
set_error_handler(function($severity, $message, $file, $line) {
if (($severity & error_reporting()) === $severity) {
$e = new ErrorException($message, 0, $severity, $file, $line);
echo "Error: $message in $file:$line\nStack trace:\n" . $e->getTraceAsString();
exit(TestCase::CODE_ERROR);
}
return FALSE;
});


$_SERVER = array_intersect_key($_SERVER, array_flip(array('PHP_SELF', 'SCRIPT_NAME', 'SERVER_ADDR', 'SERVER_SOFTWARE', 'HTTP_HOST', 'DOCUMENT_ROOT', 'OS', 'argc', 'argv')));
$_SERVER['REQUEST_TIME'] = 1234567890;
$_ENV = $_GET = $_POST = array();
Expand Down
2 changes: 1 addition & 1 deletion tests/RunTests.bat
@@ -1 +1 @@
@php.exe "%~dp0Test\RunTests.php" -p php-cgi.exe -c "%~dp0php.ini-win" -j 20 -log "%~dp0test.log" %*
@php.exe "%~dp0..\vendor\nette\tester\Tester\RunTests.phpc" -p php-cgi.exe -c "%~dp0php.ini-win" -j 20 -log "%~dp0test.log" %*

0 comments on commit 8d80012

Please sign in to comment.