コード例 #1
0
 /**
  * Fixtures load
  *
  * @param string $name The name parameter on PHPUnit_Framework_TestCase::__construct()
  * @param array  $data The data parameter on PHPUnit_Framework_TestCase::__construct()
  * @param string $dataName The dataName parameter on PHPUnit_Framework_TestCase::__construct()
  * @return void
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     if (!isset($this->fixtures)) {
         $this->fixtures = array();
     }
     $this->fixtures = array_merge($this->__fixtures, $this->fixtures);
     parent::__construct($name, $data, $dataName);
 }
コード例 #2
0
 /**
  * 期待値の取得
  *
  * @param int $id ID
  * @param array $data 登録データ
  * @param array $before 登録前データ
  * @param bool $created 作成かどうか
  * @return array
  */
 protected function _getExpected($id, $data, $before, $created)
 {
     $model = $this->_modelName;
     $expected = parent::_getExpected($id, $data, $before, $created);
     if ($created) {
         $expected[$this->{$model}->alias]['key'] = OriginalKeyBehavior::generateKey($this->{$model}->name, $this->{$model}->useDbConfig);
     }
     $expected[$this->{$model}->alias]['is_active'] = true;
     $expected[$this->{$model}->alias]['is_latest'] = true;
     return $expected;
 }