Пример #1
0
 function testReturnValues()
 {
     $entry = new PelEntryUndefined();
     $pattern = new PatternExpectation('/Missing argument 1 for ' . 'PelEntryUndefined::__construct()/');
     $this->expectError($pattern);
     $this->expectError('Undefined variable: tag');
     $entry = new PelEntryUndefined(42);
     $entry = new PelEntryUndefined(42, 'foo bar baz');
     $this->assertEqual($entry->getComponents(), 11);
     $this->assertEqual($entry->getValue(), 'foo bar baz');
 }
Пример #2
0
 /**
  * Set the version held by this entry.
  *
  * @param float the version.  The size of the entries leave room for
  * exactly four digits: two digits on either side of the decimal
  * point.
  */
 function setValue($version = 0.0)
 {
     $this->version = $version;
     $major = floor($version);
     $minor = ($version - $major) * 100;
     parent::setValue(sprintf('%02.0f%02.0f', $major, $minor));
 }
Пример #3
0
 /**
  * Set the user comment.
  *
  * @param
  *            string the new user comment.
  *
  * @param
  *            string the encoding of the comment. This should be either
  *            'ASCII', 'JIS', 'Unicode', or the empty string specifying an
  *            unknown encoding.
  */
 public function setValue($comment = '', $encoding = 'ASCII')
 {
     $this->comment = $comment;
     $this->encoding = $encoding;
     parent::setValue(str_pad($encoding, 8, chr(0)) . $comment);
 }