Пример #1
0
 /**
  * Create a new theme publish command instance.
  *
  * @param  \Cartalyst\Themes\ThemePublisher  $publisher
  * @return void
  */
 public function __construct(ThemePublisher $publisher)
 {
     parent::__construct();
     $this->publisher = $publisher;
     $me = $this;
     $this->publisher->noting(function ($note) use($me) {
         $me->line($note);
     });
 }
Пример #2
0
 public function testNotes()
 {
     $themeBag = $this->getMockThemeBag();
     $publisher = new ThemePublisher($themeBag);
     $publisher->setDispatcher($dispatcher = new Dispatcher());
     $publisher->noting(function ($note) {
         $_SERVER['__theme.publisher.note'] = $note;
     });
     $publisher->note('foo', 'info');
     $this->assertTrue(isset($_SERVER['__theme.publisher.note']));
     $this->assertEquals('<info>foo</info>', $_SERVER['__theme.publisher.note']);
     unset($_SERVER['__theme.publisher.note']);
 }