Пример #1
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $this->optInData = array('optIn' => 'This is an option', 'description' => 'This is a description');
     $this->optIn = new OptIn();
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $this->contactService = new ContactService();
     $this->contactService->setServiceLocator($this->serviceManager);
 }
Пример #3
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $this->contact = $this->entityManager->find("Contact\\Entity\\Contact", 1);
     $this->addressTypeData = array('type' => 'address type');
     $this->addressType = new AddressType();
 }
Пример #4
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1);
     $this->webData = array('contact' => $contact, 'web' => 'http://www.example.com');
     $this->web = new Web();
 }
Пример #5
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1);
     $this->emailData = array('contact' => $contact, 'email' => '*****@*****.**');
     $this->email = new Email();
 }
Пример #6
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $contact = $this->entityManager->find("Contact\\Entity\\Contact", 1);
     $this->cvData = array('contact' => $contact, 'cv' => file_get_contents(__DIR__ . '/../_files/php.exe'));
     $this->cv = new Cv();
 }
Пример #7
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
     $contact = $this->entityManager->getReference("Contact\\Entity\\Contact", 1);
     $country = $this->entityManager->getReference("General\\Entity\\Country", 1);
     $type = new \Contact\Entity\AddressType();
     $type->setType('This is the type');
     $this->addressData = array('contact' => $contact, 'country' => $country, 'type' => $type, 'address' => 'This is the Address', 'zipcode' => '1234', 'city' => 'This is the City');
     $this->address = new Address();
 }
Пример #8
0
            } elseif (is_dir($vendorPath . '/ZF2/library')) {
                $zf2Path = $vendorPath . '/ZF2/library';
            } elseif (is_dir($vendorPath . '/zendframework/zendframework/library')) {
                $zf2Path = $vendorPath . '/zendframework/zendframework/library';
            }
        }
        if (!$zf2Path) {
            throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');
        }
        if (file_exists($vendorPath . '/autoload.php')) {
            include $vendorPath . '/autoload.php';
        }
        include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
        AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'namespaces' => array(__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__, 'Admin' => __DIR__ . '/../../../../module/Admin'))));
    }
    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();
Пример #9
0
        $rootPath = dirname(static::findParentPath('module'));
        chdir($rootPath);
    }
    protected static function initAutoloader()
    {
        $vendorPath = static::findParentPath('vendor');
        if (file_exists($vendorPath . '/autoload.php')) {
            include $vendorPath . '/autoload.php';
        }
        if (!class_exists('Zend\\Loader\\AutoloaderFactory')) {
            throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install`');
        }
        AutoloaderFactory::factory(['Zend\\Loader\\StandardAutoloader' => ['autoregister_zf' => true, 'namespaces' => [__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();
Bootstrap::chroot();
Пример #10
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->contactService = new ContactService();
     $this->contactService->setServiceLocator($this->serviceManager);
 }
Пример #11
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default');
 }