コード例 #1
0
 protected function setUp()
 {
     parent::setUp();
     $this->controller = new CrudController();
     $sm = new ServiceManagerTestCase();
     $this->controller->setServiceLocator($sm->getServiceManager());
     $pluginManager = $this->getMock('Zend\\Mvc\\Controller\\PluginManager', array('get'));
     $pluginManager->expects($this->any())->method('get')->will($this->returnCallback(array($this, 'helperMockCallbackPluginManagerGet')));
     $this->pluginManager = $pluginManager;
     $this->controller->setPluginManager($pluginManager);
 }
コード例 #2
0
ファイル: bootstrap.php プロジェクト: acplo/acplobase
<?php

use AcploBaseTest\ServiceManagerTestCase;
ini_set('error_reporting', E_ALL);
$files = [__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../../../autoload.php'];
foreach ($files as $file) {
    if (file_exists($file)) {
        $loader = (require $file);
        break;
    }
}
if (!isset($loader)) {
    throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');
}
/* @var $loader \Composer\Autoload\ClassLoader */
$loader->add('AcploBase\\', __DIR__ . '/../src/');
$loader->add('AcploBaseTest\\', __DIR__);
if (file_exists(__DIR__ . '/TestConfiguration.php')) {
    $config = (require __DIR__ . '/TestConfiguration.php');
} else {
    $config = (require __DIR__ . '/TestConfiguration.php.dist');
}
ServiceManagerTestCase::setConfiguration($config);
unset($files, $file, $loader, $config);