Beispiel #1
0
 /**
  *
  * @dataProvider providerTestGetOffice
  * @param array $config
  * @param array $params
  * @param array $expected
  * @param unknown_type $exceptionName
  */
 public function atestGetOffice(array $config, array $params, array $expected, $exceptionName = '')
 {
     if ($exceptionName) {
         $this->setExpectedException($exceptionName);
     }
     $obj = new Miao_Office_Factory($config);
     $frontOffice = $obj->getOffice($params);
     $types = Miao_Office::getTypesObject();
     foreach ($types as $type) {
         $this->assertEquals($expected[$type], get_class($frontOffice->getObject($type)));
     }
 }
Beispiel #2
0
<?php

require realpath(dirname(__FILE__) . '/../../../') . '/scripts/bootstrap.php';
try {
    $request = Miao_Office_Request::getInstance();
    $params = $_GET;
    $factory = new Miao_Office_Factory(array('defaultPrefix' => '${born-properties.lib_name}_FrontOffice'));
    $fo = $factory->getOffice($params, array('_view' => 'Main'));
    $fo->sendResponse(false);
} catch (Exception $e) {
    // --- dump ---
    echo '<pre>';
    echo __FILE__ . chr(10);
    echo __METHOD__ . chr(10);
    var_dump($e);
    echo '</pre>';
    // --- // ---
}