Exemplo n.º 1
0
 public function testToRegister(UnitTester $I)
 {
     $data = ['host_name' => 'localhost', 'description' => 'localhost-desc', 'template_name' => 'localhost_tmpl', 'alias' => 'localhost_alias', 'is_template' => 'N', 'address' => '127.0.0.1', 'data' => ''];
     $hostManager = \App::make('Stigma\\ObjectManager\\HostManager');
     $ret = $hostManager->register($data);
     $I->assertEquals($data['host_name'], $ret->host_name);
     $I->assertEquals($data['description'], $ret->description);
     $I->assertEquals($data['template_name'], $ret->template_name);
     $I->assertEquals($data['alias'], $ret->alias);
     $I->assertEquals($data['address'], $ret->address);
     $I->assertEquals($data['is_template'], $ret->is_template);
     $I->assertEquals($data['data'], $ret->data);
     $I->seeRecord('hosts', array('host_name' => $data['host_name']));
 }
Exemplo n.º 2
0
 public function testToRegister(UnitTester $I)
 {
     $data = ['host_name' => 'localhost', 'template_ids' => '1,2,3', 'command_id' => 1, 'command_argument' => 'abc', 'service_ids' => '1,2,3', 'is_template' => 'N', 'address' => '127.0.0.1', 'data' => ''];
     $hostManager = \App::make('Stigma\\ObjectManager\\HostManager');
     $ret = $hostManager->register($data);
     $I->assertEquals($data['host_name'], $ret->host_name);
     //$I->assertEquals($data['description'] , $ret->description) ;
     //$I->assertEquals($data['template_name'] , $ret->template_name) ;
     //$I->assertEquals($data['alias'] , $ret->alias) ;
     $I->assertEquals($data['address'], $ret->address);
     $I->assertEquals($data['is_template'], $ret->is_template);
     $I->assertEquals($data['template_ids'], $ret->template_ids);
     $I->assertEquals($data['command_id'], $ret->command_id);
     $I->assertEquals($data['command_argument'], $ret->command_argument);
     $I->assertEquals($data['service_ids'], $ret->service_ids);
     $I->assertEquals(json_encode($data), $ret->data);
     $I->seeRecord('hosts', array('host_name' => $data['host_name']));
 }
Exemplo n.º 3
0
 public function testToRegister(UnitTester $I)
 {
     $data = ['service_name' => 'ping service', 'service_description' => 'this is ping service', 'template_ids' => '1,2,3,4', 'is_template' => 'N', 'data' => ''];
     $serviceManager = \App::make('Stigma\\ObjectManager\\ServiceManager');
     $ret = $serviceManager->register($data);
     $I->assertEquals($data['service_name'], $ret->service_name);
     $I->assertEquals($data['service_description'], $ret->service_description);
     $I->assertEquals($data['template_ids'], $ret->template_ids);
     $I->assertEquals($data['is_template'], $ret->is_template);
     $I->assertEquals($data['data'], $ret->data);
     $I->seeRecord('services', array('service_name' => $data['service_name']));
 }