-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the Renderer and add the Converter.
- Loading branch information
Showing
6 changed files
with
65 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace spec\drupol\phptree\Converter; | ||
|
||
use drupol\phptree\Converter\Graph; | ||
use drupol\phptree\Node\Node; | ||
use PhpSpec\ObjectBehavior; | ||
|
||
class GraphSpec extends ObjectBehavior | ||
{ | ||
public function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(Graph::class); | ||
} | ||
|
||
public function it_can_generate_a_graph() | ||
{ | ||
$root = new Node(); | ||
$level1 = new Node(); | ||
$level2 = new Node(); | ||
|
||
$root | ||
->add($level1, $level2); | ||
|
||
$this | ||
->convert($root) | ||
->shouldReturnAnInstanceOf(\Fhaculty\Graph\Graph::class); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace drupol\phptree\Converter; | ||
|
||
use drupol\phptree\Node\NodeInterface; | ||
|
||
/** | ||
* Interface ConverterInterface. | ||
*/ | ||
interface ConverterInterface | ||
{ | ||
/** | ||
* @param \drupol\phptree\Node\NodeInterface $node | ||
* | ||
* @return mixed | ||
*/ | ||
public function convert(NodeInterface $node); | ||
} |
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 was deleted.
Oops, something went wrong.