-
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.
- Loading branch information
Showing
2 changed files
with
5 additions
and
22 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 |
---|---|---|
@@ -1,14 +1,5 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ICanBoogie\Binding\ActiveRecord; | ||
|
||
use ICanBoogie\ActiveRecord; | ||
|
@@ -30,7 +21,7 @@ final class Hooks | |
*/ | ||
public static function on_app_boot(Application\BootEvent $event): void | ||
{ | ||
StaticModelProvider::define( | ||
StaticModelProvider::set( | ||
static fn() => $event->app->service_for_class(ModelProvider::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ICanBoogie package. | ||
* | ||
* (c) Olivier Laviale <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Test\ICanBoogie\Binding\ActiveRecord; | ||
|
||
use ICanBoogie\ActiveRecord\StaticModelProvider; | ||
use ICanBoogie\Application\BootEvent; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
final class ServicesTest extends TestCase | ||
{ | ||
/** | ||
* Troubleshoot: config/event.php | ||
* Asserts {@link BootEvent} was leveraged to configure the static model provider. | ||
*/ | ||
public function test_get_models(): void | ||
public function test_get_model_provider(): void | ||
{ | ||
$this->assertNotNull(StaticModelProvider::defined()); | ||
$this->assertNotNull(StaticModelProvider::get()); | ||
} | ||
} |