set() 정적인 공개 메소드

static public set ( string $key, mixed $val, string $type = null )
$key string
$val mixed
$type string (optional)
예제 #1
0
 /**
  * Override
  */
 public function setUp()
 {
     parent::setUp();
     // Replace GlobalTypography service with mock
     Container::set('GlobalTypography', function () {
         $stub = $this->getMockBuilder('\\Pressbooks\\GlobalTypography')->getMock();
         return $stub;
     });
     // Replace Sass service with mock
     Container::set('Sass', function () {
         $stub = $this->getMockBuilder('\\Pressbooks\\Sass')->getMock();
         $stub->method('pathToUserGeneratedCss')->willReturn($this->_createTmpDir());
         $stub->method('pathToPartials')->willReturn(PB_PLUGIN_DIR . 'assets/scss/partials');
         return $stub;
     });
 }
예제 #2
0
 /**
  * @covers \Pressbooks\Container::set
  */
 public function test_setException()
 {
     $this->setExpectedException('\\LogicException');
     Container::set('foo', 'bar');
 }