示例#1
0
 /**
  * Test application service aliases
  */
 public function testAppCallServiceAlias()
 {
     $config = array('db' => array('dsn' => DB_DSN), 'logger' => array('buffer' => DATA_PATH . '/log.txt'), 'server' => array('url' => '/', 'hostname' => 'localhost'), 'security' => array('salt' => 'dummy', 'hash' => 'sha256'), 'mailer' => array('from' => array('email' => '*****@*****.**', 'name' => 'Duality Mailer'), 'smtp' => array('host' => 'smtp.gmail.com', 'user' => 'username', 'pass' => 'password', 'encr' => 'tls', 'port' => 587, 'dbgl' => 0)), 'remote' => array('localhost' => array('username' => '', 'password' => '')), 'auth' => array('table' => 'dummy', 'user' => 'email', 'pass' => 'pass'));
     $app = new \Duality\App(dirname(__FILE__) . '/../..', $config);
     $expected = '\\Duality\\Service\\Database';
     $this->assertInstanceOf($expected, $app->getDb());
     $expected = '\\Duality\\Service\\Logger';
     $this->assertInstanceOf($expected, $app->getLogger());
     $expected = '\\Duality\\Service\\Security';
     $this->assertInstanceOf($expected, $app->getSecurity());
     $expected = '\\Duality\\Service\\Validator';
     $this->assertInstanceOf($expected, $app->getValidator());
     $expected = '\\Duality\\Service\\Session';
     $this->assertInstanceOf($expected, $app->getSession());
     $expected = '\\Duality\\Service\\Logger';
     $this->assertInstanceOf($expected, $app->getLogger());
     $expected = '\\Duality\\Service\\Auth';
     $this->assertInstanceOf($expected, $app->getAuth());
     $expected = '\\Duality\\Service\\Mailer';
     $this->assertInstanceOf($expected, $app->getMailer());
     $expected = '\\Duality\\Service\\Paginator';
     $this->assertInstanceOf($expected, $app->getPaginator());
     $expected = '\\Duality\\Service\\SSH';
     $this->assertInstanceOf($expected, $app->getRemote());
     $expected = '\\Duality\\Service\\Server';
     $this->assertInstanceOf($expected, $app->getServer());
     $expected = '\\Duality\\Service\\Commander';
     $this->assertInstanceOf($expected, $app->getCmd());
     $expected = '\\Duality\\Service\\Client';
     $this->assertInstanceOf($expected, $app->getClient());
     $expected = '\\Duality\\Service\\Performance';
     $this->assertInstanceOf($expected, $app->getPerformance());
 }