Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend: Set name if create default backend
fixes #7043
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tests\Icinga\Module\Monitoring\Regression; | ||
|
||
use Icinga\Data\ResourceFactory; | ||
use Icinga\Module\Monitoring\Backend; | ||
use Icinga\Test\BaseTestCase; | ||
|
||
class Bug7043 extends BaseTestCase | ||
{ | ||
public function testBackendDefaultName() | ||
{ | ||
$config = new \Zend_Config(array( | ||
'ido' => array( | ||
'type' => 'db', | ||
'db' => 'mysql', | ||
'host' => 'localhost', | ||
'port' => '3306', | ||
'password' => 'icinga', | ||
'username' => 'icinga', | ||
'dbname' => 'icinga' | ||
) | ||
)); | ||
|
||
ResourceFactory::setConfig($config); | ||
|
||
$defaultBackend = Backend::createBackend(); | ||
|
||
$this->assertNotNull($defaultBackend->getName(), 'Default backend has a name property set'); | ||
} | ||
} |