Skip to content

Commit

Permalink
update all scope references to Peridot\Core\Scope
Browse files Browse the repository at this point in the history
  • Loading branch information
brianium committed Nov 16, 2014
1 parent 0002256 commit 24866ac
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion specs/suite.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Peridot\Core\Test;
use Peridot\Core\TestResult;
use Peridot\Core\Suite;
use Peridot\Scope\Scope;
use Peridot\Core\Scope;
use Peridot\Test\ItWasRun;

describe("Suite", function() {
Expand Down
2 changes: 1 addition & 1 deletion specs/test.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Peridot\Core\Test;
use Peridot\Core\TestResult;
use Peridot\Core\Suite;
use Peridot\Scope\Scope;
use Peridot\Core\Scope;
use Peridot\Test\ItWasRun;

describe("Test", function() {
Expand Down
33 changes: 30 additions & 3 deletions src/Core/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Peridot\Core;

use Peridot\Scope\ScopeTrait;

/**
* Base class for Peridot Suites and Tests
*
Expand All @@ -12,7 +10,6 @@
abstract class AbstractTest implements TestInterface
{
use HasEventEmitterTrait;
use ScopeTrait;

/**
* The test definition as a callable.
Expand Down Expand Up @@ -50,6 +47,11 @@ abstract class AbstractTest implements TestInterface
*/
protected $pending = null;

/**
* @var Scope
*/
protected $scope;

/**
* @param string $description
* @param callable $definition
Expand All @@ -58,6 +60,7 @@ public function __construct($description, callable $definition)
{
$this->definition = $definition;
$this->description = $description;
$this->scope = new Scope();
}

/**
Expand Down Expand Up @@ -212,4 +215,28 @@ public function forEachNodeTopDown(callable $fn)
$fn($node);
}
}

/**
* {@inheritdoc}
*
* @return Scope
*/
public function getScope()
{
return $this->scope;
}

/**
* {@inheritdoc}
*
* @param Scope $scope
* @return mixed
*/
public function setScope(Scope $scope)
{
$this->scope = $scope;
return $this;
}


}
1 change: 0 additions & 1 deletion src/Core/TestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Peridot\Core;

use Evenement\EventEmitterInterface;
use Peridot\Scope\Scope;

/**
* Defines the contract for Peridot test fixtures like Test and Suite
Expand Down

0 comments on commit 24866ac

Please sign in to comment.