Пример #1
0
 function testReturnValues()
 {
     $entry = new PelEntryRational();
     $pattern = new WantedPatternExpectation('/Missing argument 1 for ' . 'PelEntryRational::__construct()/');
     $this->assertError($pattern);
     $this->assertError('Undefined variable: tag');
     $entry = new PelEntryRational(42);
     $this->assertEqual($entry->getValue(), array());
     $this->assertEqual($entry->getText(), '');
     $entry->setValue(array(1, 2), array(3, 4), array(5, 6));
     $this->assertEqual($entry->getValue(), array(array(1, 2), array(3, 4), array(5, 6)));
     $this->assertEqual($entry->getText(), '1/2, 3/4, 5/6');
     $entry->setValue(array(7, 8));
     $this->assertEqual($entry->getValue(), array(7, 8));
     $this->assertEqual($entry->getText(), '7/8');
     $entry->setValue();
     $this->assertEqual($entry->getValue(), array());
     $this->assertEqual($entry->getText(), '');
     $entry->setValue(array(0, 4294967295));
     $this->assertEqual($entry->getValue(), array(0, 4294967295));
     $this->assertEqual($entry->getText(), '0/4294967295');
 }