setField1() public method

public setField1 ( string $field1 ) : self
$field1 string
return self
コード例 #1
0
 /**
  * @test
  */
 public function testListConversion()
 {
     $c1 = new SimpleModelTestClass();
     $c1->setField1("a")->setField2('value');
     $c2 = new SimpleModelTestClass();
     $c1->setField1("another")->setField2('object');
     $parent = new ListModelTestClass();
     $parent->setList1(array('simple', 'list', 'with', 'integer', 'keys'));
     $parent->setList2(array($c1, $c2));
     $parentCopy = new ListModelTestClass();
     $parentCopy->fromJson($parent->toJSON());
     $this->assertEquals($parent, $parentCopy);
 }
コード例 #2
0
ファイル: PayPalModelTest.php プロジェクト: Roc4rdho/app
 /**
  * @dataProvider EmptyNullProvider
  * @param string|null $field2
  * @param bool $matches
  */
 public function testEmptyNullConversion($field2, $matches)
 {
     $c1 = new SimpleModelTestClass();
     $c1->setField1("a")->setField2($field2);
     $this->assertTrue(strpos($c1->toJSON(), "field2") !== !$matches);
 }