Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the setting of parent headers, make more flexible to run the test... #5

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
@@ -0,0 +1,8 @@
language: php
php:
- 5.4
- 5.5
before_script:
- composer install
- cd tests
script: phpunit
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -28,5 +28,6 @@
"branch-alias": {
"dev-develop-2": "2.0.x-dev"
}
}
},
"minimum-stability": "dev"
}
4 changes: 4 additions & 0 deletions config/integration/modify.php
Expand Up @@ -6,6 +6,10 @@
$response = $di->get('web_response');
$router = $di->get('web_router');

// get logger service and disable
$logger = $di->get('logger');
$logger->pushHandler($di->newInstance('Monolog\Handler\NullHandler'));

$router->add(null, '/aura/web-kernel/integration/hello')
->addValues(array(
'controller' => function () use ($request, $response) {
Expand Down
8 changes: 6 additions & 2 deletions scripts/kernel.php
Expand Up @@ -10,9 +10,13 @@
*
*/
namespace Aura\Web_Kernel;

// get the project kernel
$base = dirname(dirname(dirname(dirname(__DIR__))));
if (isset($_ENV['AURA_TESTING_BASE_DIR'])) {
$base = $_ENV['AURA_TESTING_BASE_DIR'];
} else {
$base = dirname(dirname(dirname(dirname(__DIR__))));
}

$project_kernel = require "{$base}/vendor/aura/project-kernel/scripts/kernel.php";

// invoke it to get the DI container
Expand Down
13 changes: 9 additions & 4 deletions tests/bootstrap.php
Expand Up @@ -7,10 +7,15 @@
$base = dirname(dirname(dirname(dirname(__DIR__))));
$file = "{$base}/vendor/autoload.php";
if (! is_readable($file)) {
echo "Did not find '{$file}'." . PHP_EOL;
echo "It looks like you are not in a Composer installation." . PHP_EOL;
exit(1);
$_ENV['AURA_TESTING_BASE_DIR'] = $base = dirname(__DIR__);
$file1 = "{$base}/vendor/autoload.php";
if (! is_readable($file1)) {
echo "Did not find '{$file}' or '{$file1}'." . PHP_EOL;
echo "It looks like you are not in a Composer installation." . PHP_EOL;
exit(1);
}
require "{$base}/autoload.php";
$file = $file1;
}

// include the composer autoloader
require $file;
6 changes: 0 additions & 6 deletions tests/src/IntegrationResponder.php
Expand Up @@ -22,18 +22,12 @@ public function __get($key)

protected function header($string)
{
// for test coverage
parent::header(null);

// retain the string
$this->headers[] = $string;
}

protected function setcookie($name, $value, $expire, $path, $domain, $secure, $httponly)
{
// for test coverage
parent::setcookie(null, null, null, null, null, null, null);

// retain the cookie
$this->cookies[] = array(
'name' => $name,
Expand Down