Permalink
Browse files

Adds autoloading to test stubs

  • Loading branch information...
1 parent 8c1ce0c commit 701834b3324c304ef8ea002759890d18c834e950 @davedevelopment committed Apr 19, 2012
Showing with 6 additions and 9 deletions.
  1. +6 −9 tests/Mutagenesis/Utility/ProcTest.php
@@ -42,15 +42,14 @@ public function testExecutesGivenScriptInSeparateProcess()
public function testSeparateProcessCompletesPreTimeout()
{
$process = new \Mutagenesis\Utility\Process;
+ $autoload = realpath(__DIR__."/../../../vendor/.composer/autoload.php");
$timeout = 120;
$job = <<<JOB
<?php
namespace MutagenesisEnv;
declare(ticks = 1);
require_once 'PHPUnit/Autoload.php';
-require_once 'Mutagenesis/Loader.php';
-\$loader = new \Mutagenesis\Loader;
-\$loader->register();
+include "$autoload";
class Job {
static function main () {
sleep(1);
@@ -81,14 +80,13 @@ public function testSeparateProcessCanTimeout()
{
$process = new \Mutagenesis\Utility\Process;
$timeout = 1;
+ $autoload = realpath(__DIR__."/../../../vendor/.composer/autoload.php");
$job = <<<JOB
<?php
namespace MutagenesisEnv;
declare(ticks = 1);
require_once 'PHPUnit/Autoload.php';
-require_once 'Mutagenesis/Loader.php';
-\$loader = new \Mutagenesis\Loader;
-\$loader->register();
+include "$autoload";
class Job {
static function main () {
sleep(2);
@@ -119,14 +117,13 @@ public function testSeparateProcessCanThrowExceptions()
{
$process = new \Mutagenesis\Utility\Process;
$timeout = 120;
+ $autoload = realpath(__DIR__."/../../../vendor/.composer/autoload.php");
$job = <<<JOB
<?php
namespace MutagenesisEnv;
declare(ticks = 1);
require_once 'PHPUnit/Autoload.php';
-require_once 'Mutagenesis/Loader.php';
-\$loader = new \Mutagenesis\Loader;
-\$loader->register();
+include "$autoload";
class Job {
static function main () {
throw new \\Exception();

0 comments on commit 701834b

Please sign in to comment.