コード例 #1
0
ファイル: CustomFieldTest.php プロジェクト: rrsc/snipe-it
 public function testValidation()
 {
     $f = new CustomField();
     $f->name = 'Id';
     $f->format = 'IP';
     $f->element = "text";
     /*$this->assertDoesntThrow(function () {
         $f->save();
       });*/
     $this->assertFalse(CustomField::saving($f));
     //horrible hacky workaround to even problems
     //for Laravel testing. Blech.
     $g = new CustomField();
     $g->name = 'totally_unique_name';
     $g->format = 'IP';
     $g->element = "text";
     //$this->assertTrue($g->validate($g->toArray()));
     $this->assertTrue(CustomField::saving($g));
     /*$this->assertThrows(function () {
         $f->save();
       });*/
 }