コード例 #1
0
ファイル: plan.test.php プロジェクト: Navdeep736/regetp01
 function testTieneEstructuraDefinida()
 {
     $this->assertFalse($this->Plan->tieneEstructuraDefinida(1));
     $this->assertTrue($this->Plan->tieneEstructuraDefinida(2));
     $this->assertFalse($this->Plan->tieneEstructuraDefinida(3));
     $this->assertTrue($this->Plan->tieneEstructuraDefinida(8));
     $this->assertTrue($this->Plan->tieneEstructuraDefinida(11));
     $this->assertFalse($this->Plan->tieneEstructuraDefinida(7));
     $this->Plan->id = 7;
     $this->Plan->recursive = -1;
     if (!$this->Plan->saveField('oferta_id', 3, false)) {
         $this->fail('No se pudo guardar un campo del plan');
     }
     if (!$this->Plan->saveField('estructura_plan_id', 3, false)) {
         $this->fail('No se pudo guardar la estructura sugerida');
     }
     $this->assertTrue($this->Plan->tieneEstructuraDefinida(7));
 }