-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from bearsunday/voidv8
add VoidV8Module
- Loading branch information
Showing
6 changed files
with
56 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* This file is part of the BEAR\ReactJsModule package | ||
* | ||
* @license http://opensource.org/licenses/MIT MIT | ||
*/ | ||
namespace BEAR\ReactJsModule; | ||
|
||
use Koriym\ReduxReactSsr\VoidV8Js; | ||
use Ray\Di\AbstractModule; | ||
|
||
class VoidV8Module extends AbstractModule | ||
{ | ||
public function __construct($module = null) | ||
{ | ||
parent::__construct($module); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function configure() | ||
{ | ||
$this->bind(\V8Js::class)->to(VoidV8Js::class); | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
namespace BEAR\ReactJsModule; | ||
|
||
use Ray\Di\Injector; | ||
|
||
class VoidV8ModuleTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testModule() | ||
{ | ||
$uiPath = __DIR__ . '/Fake'; | ||
$injector = new Injector(new VoidV8Module(new ReduxModule($uiPath, 'ssr_app'))); | ||
$ro = $injector->getInstance(FakeReduxRo::class); | ||
$body = (string) $ro; | ||
$this->assertContains('<div id="root"></div>', $body); | ||
} | ||
} |