/** * 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; }); }
/** * @covers \Pressbooks\Container::set */ public function test_setException() { $this->setExpectedException('\\LogicException'); Container::set('foo', 'bar'); }