-
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.
change: allow set Application without initial construct
* FIx typo method
- Loading branch information
1 parent
02e78a7
commit 274a1f5
Showing
4 changed files
with
29 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
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 |
---|---|---|
@@ -1,22 +1,21 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use System\Collection\Collection; | ||
use System\Integrate\Application; | ||
use System\Support\Facades\Facade; | ||
|
||
final class FacadeTest extends TestCase | ||
{ | ||
/** @test */ | ||
final public function itCanCallstatic() | ||
{ | ||
$app = new Application(__DIR__); | ||
$app->set(System\Time\Now::class, fn () => new System\Time\Now()); | ||
$app->set(Collection::class, fn () => new Collection(['php' => 'greate'])); | ||
|
||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'Sample' . DIRECTORY_SEPARATOR . 'FacadesTestClass.php'; | ||
new FacadesTestClass($app); | ||
Facade::setFacadeBase($app); | ||
|
||
FacadesTestClass::year(2025); | ||
$year = FacadesTestClass::isNextYear(); | ||
|
||
$this->assertTrue($year); | ||
$this->assertTrue(FacadesTestClass::has('php')); | ||
} | ||
} |
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,15 +1,15 @@ | ||
<?php | ||
|
||
use System\Collection\Collection; | ||
use System\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static \System\Time\Now year(int $year) | ||
* @method static bool isNextYear() | ||
* @method static bool has(string $key) | ||
*/ | ||
final class FacadesTestClass extends Facade | ||
{ | ||
protected static function getAccessor() | ||
{ | ||
return System\Time\Now::class; | ||
return Collection::class; | ||
} | ||
} |