示例#1
0
 public function testFilterTest()
 {
     $index = mt_rand(1, 10);
     $filterTest = new FilterTest($index, true);
     $this->assertSame($index, $filterTest->getIndex());
     $this->assertTrue($filterTest->getNegative());
     $filterTest->setIndex($index)->setNegative(true);
     $this->assertSame($index, $filterTest->getIndex());
     $this->assertTrue($filterTest->getNegative());
     $xml = '<?xml version="1.0"?>' . "\n" . '<filterTest index="' . $index . '" negative="true" />';
     $this->assertXmlStringEqualsXmlString($xml, (string) $filterTest);
     $array = array('filterTest' => array('index' => $index, 'negative' => true));
     $this->assertEquals($array, $filterTest->toArray());
 }
示例#2
0
 /**
  * Returns the array representation of this class 
  *
  * @return array
  */
 public function toArray($name = 'importanceTest')
 {
     return parent::toArray($name);
 }
示例#3
0
 /**
  * Returns the array representation of this class 
  *
  * @param  string $name
  * @return array
  */
 public function toArray($name = 'inviteTest')
 {
     return parent::toArray($name);
 }