Exemplo n.º 1
0
 public function setup()
 {
     static::$config = (require __DIR__ . '/../config.php');
     // append biller conf
     static::$config['biller'] = ['key' => self::API_KEY, 'custom_id' => 'id', 'custom_email' => 'email'];
     $di = new \Phalcon\DI\FactoryDefault();
     $di->set('config', static::$config);
     $di->set('db', function () {
         return new \Phalcon\Db\Adapter\Pdo\Mysql(array('host' => '127.0.0.1', 'username' => 'root', 'password' => '', 'dbname' => 'biller_tests', 'charset' => 'utf8'));
     });
     // Session manager
     $di->setShared('session', function () {
         $session = new \Phalcon\Session\Adapter\Files();
         $session->start();
         return $session;
     });
     self::authorize();
     static::$mock = new \Tests\User();
 }
Exemplo n.º 2
0
 public static function setMock($mock)
 {
     static::$mock = $mock;
 }
Exemplo n.º 3
0
 /**
  * Initiate a mock expectation on the facade.
  *
  * @param  dynamic
  * @return \Mockery\Expectation
  */
 public static function __callStatic($name, $arguments)
 {
     if ($name == 'shouldReceive') {
         if (!static::$mock) {
             static::$mock = \Mockery::mock(get_called_class() . 'Mock');
         }
         return call_user_func_array(array(static::$mock, 'shouldReceive'), $arguments);
     }
 }