Class Zit
Author: Selvin Ortiz - https://selvinortiz.com
Inheritance: implements SelvinOrtiz\Zit\IZit
コード例 #1
0
ファイル: ZitTest.php プロジェクト: speder/craft.minimee
 public function testExtend()
 {
     $zit = Zit::getInstance();
     $zit->extend('myCallable', function () {
         return 12345;
     });
     $this->assertTrue($zit->myCallable() === 12345);
     $this->assertTrue(Zit::myCallable() === 12345);
 }
コード例 #2
0
ファイル: ZitTest.php プロジェクト: johndwells/craft.minimee
 public function testStashWithSameIdAsProtectedProperty()
 {
     $zit = Zit::getInstance();
     $instance = new \stdClass();
     $instance->id = 'testServices';
     $zit->stash('services', $instance);
     $this->assertTrue($zit->services instanceof \stdClass);
     $this->assertSame('testServices', $zit->services->id);
 }
コード例 #3
0
ファイル: ZitTest.php プロジェクト: selvinortiz/zit
 public function test_stash_with_same_id_as_protected_property()
 {
     $zit = Zit::make();
     $myObject = new \stdClass();
     $myObject->id = 'testServices';
     $zit->stash('services', $myObject);
     $this->assertTrue($zit->services instanceof \stdClass);
     $this->assertSame('testServices', $zit->services->id);
 }
コード例 #4
0
 function minimee()
 {
     return Zit::getInstance();
 }