set() static public method

static public set ( string $key, mixed $val, string $type = null )
$key string
$val mixed
$type string (optional)
 /**
  * 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;
     });
 }
Example #2
0
 /**
  * @covers \Pressbooks\Container::set
  */
 public function test_setException()
 {
     $this->setExpectedException('\\LogicException');
     Container::set('foo', 'bar');
 }