Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Tests\Unit;
- /**
- * Базовый класс для Unit-тестов
- * @package Tests\Unit
- */
- abstract class Base extends \Codeception\TestCase\Test
- {
- /**
- * @var \Phalcon\Mvc\Micro
- */
- protected $app;
- /**
- * @var \Grumpy\Bootstrap
- */
- protected $bs;
- /**
- * @var \Phalcon\DI\FactoryDefault
- */
- protected $di;
- /**
- * @var \Api\Drivers\Interfaces\Storage
- */
- protected $storage;
- public function getApp()
- {
- return \PHPUnit_Framework_Assert::readAttribute($this->bs, 'app');
- }
- public function getBs()
- {
- if(!$this->bs) {
- return new Bootstrap(require_once LOADER_PATH);
- }
- return $this->bs;
- }
- public function getDi()
- {
- return $this->bs->getDi();
- }
- public function getStorage()
- {
- return $this->bs->getStorage();
- }
- /**
- * Конструктор
- */
- protected function __before()
- {
- $this->bs = $this->getBs();
- $this->di = $this->getDi();
- $this->storage = $this->getStorage();
- $this->app = $this->getApp();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement