/**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  */
 protected function setUp()
 {
     Bootstrap::getServiceManager()->setAllowOverride(true);
     $client = new Client(['handler' => new MockHandler()]);
     $this->testedDao = $this->getTestedDao();
     $this->testedDao->setDataProvider($client);
 }
Example #2
0
 /**
  * Proper API method, not all required params given - should throw an Exception
  * @expectedException \Dashboard\Model\Dao\Exception\EndpointUrlNotAssembled
  */
 public function testNotAllRequiredParamsGiven()
 {
     Bootstrap::getServiceManager()->get('JenkinsDao')->fetchStatusForBuildWidget(['view' => 'VGTV']);
 }
Example #3
0
                    $zf2Path = ZF2_PATH;
                } elseif (is_dir($vendorPath . '/ZF2/library')) {
                    $zf2Path = $vendorPath . '/ZF2/library';
                } else {
                    $zf2Path = false;
                }
            }
            if (!$zf2Path) {
                throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install`
                    or define a ZF2_PATH environment variable.');
            }
            include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
        }
        AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'namespaces' => array(__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__))));
    }
    protected static function findParentPath($path)
    {
        $dir = __DIR__;
        $previousDir = '.';
        while (!is_dir($dir . '/' . $path)) {
            $dir = dirname($dir);
            if ($previousDir === $dir) {
                return false;
            }
            $previousDir = $dir;
        }
        return $dir . '/' . $path;
    }
}
Bootstrap::init();
Example #4
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  */
 protected function setUp()
 {
     Bootstrap::getServiceManager()->setAllowOverride(true);
     $this->testedDao = $this->getTestedDao();
     $this->testedDao->getDataProvider()->setAdapter(new \Zend\Http\Client\Adapter\Test());
 }