예제 #1
0
 /**
  * Constructor
  *
  * If a class is extending AppTestCase it will merge these with the extending classes
  * so that you don't have to put the plugin fixtures into the AppTestCase
  *
  * @return void
  */
 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     if (is_subclass_of($this, 'AppTestCase')) {
         $parentClass = get_parent_class($this);
         $parentVars = get_class_vars($parentClass);
         if (isset($parentVars['fixtures'])) {
             $this->fixtures = array_unique(array_merge($parentVars['fixtures'], $this->fixtures));
         }
         if (!empty($this->plugin)) {
             $this->dependedFixtures = $this->solveDependancies($this->plugin);
         }
         if (!empty($this->dependedFixtures)) {
             foreach ($this->dependedFixtures as $plugin) {
                 $fixtures = $this->loadConfig('fixtures', $plugin);
                 if (!empty($fixtures)) {
                     $this->fixtures = array_unique(array_merge($this->fixtures, $fixtures));
                 }
             }
         }
     }
 }