/**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['sherlock'] = $this->app->share(function ($app) {
         $sherlock = new Sherlock();
         foreach (Config::get('sherlock::nodes') as $node) {
             $sherlock->addNode($node['host'], $node['port']);
         }
         return $sherlock;
     });
 }
Esempio n. 2
0
 /**
  * @covers sherlock\Sherlock::addNode
  */
 public function testAddNode()
 {
     $ret = $this->object->addNode('localhost');
     $this->assertInstanceOf('\\sherlock\\sherlock', $ret);
 }
Esempio n. 3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->object = new Sherlock();
     $this->object->addNode('localhost', '9200');
 }