-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for disparate graphs and the new belongsOrEquals method for C…
…ontextInterface classes
- Loading branch information
Emre Sokullu
committed
May 2, 2017
1 parent
75e309d
commit 671d819
Showing
4 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Pho package. | ||
* | ||
* (c) Emre Sokullu <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Pho\Framework; | ||
|
||
use Pho\Lib\Graph\Predicate; | ||
|
||
class RecursiveContextsTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
private $graph; | ||
|
||
public function setUp() { | ||
$this->graph = new Graph(); | ||
} | ||
|
||
public function tearDown() { | ||
unset($this->graph); | ||
} | ||
|
||
public function testGraph() { | ||
$this->assertTrue($this->graph->belongsOrEquals($this->graph)); | ||
} | ||
|
||
public function testFrame() { | ||
$actor = new Actor($this->graph); | ||
$frame = new Frame($actor, $this->graph); | ||
$this->assertTrue($frame->belongsOrEquals($this->graph)); | ||
} | ||
|
||
public function testSubFrame() { | ||
$actor = new Actor($this->graph); | ||
$frame = new Frame($actor, $this->graph); | ||
$subframe = new Frame($actor, $frame); | ||
$this->assertTrue($subframe->belongsOrEquals($this->graph)); | ||
$this->assertTrue($subframe->belongsOrEquals($frame)); | ||
} | ||
|
||
public function testDisparateGraphs() { | ||
$new_graph = new Graph(); | ||
$actor = new Actor($this->graph); | ||
$frame = new Frame($actor, $this->graph); | ||
$subframe = new Frame($actor, $frame); | ||
$this->assertFalse($this->graph->belongsOrEquals($new_graph)); | ||
$this->assertFalse($frame->belongsOrEquals($new_graph)); | ||
$this->assertFalse($subframe->belongsOrEquals($new_graph)); | ||
$this->assertTrue($subframe->belongsOrEquals($this->graph)); | ||
} | ||
|
||
} |