Esempio n. 1
0
 public function testConstructWithString()
 {
     $set = new Text();
     $this->assertSame((string) $set, '');
     $set = new Text('6');
     $this->assertSame((string) $set, '6');
     $filthyString = '"\\$%\\-:9';
     $set = new Text(Set::escape($filthyString));
     $this->assertSame($set->intervals[0][0], $filthyString);
     $this->assertTrue($set->contains(array($filthyString)));
     $set = new Text('-B');
     $this->assertSame((string) $set, '-B');
     $set = new Text('9-');
     $this->assertSame((string) $set, '9-');
     $set = new Text('1,2,3');
     $this->assertSame((string) $set, '1,2,3');
     $set = new Text('1,,');
     $this->assertSame((string) $set, '1');
     $set = new Text('1,1,1');
     $this->assertSame((string) $set, '1');
     $set = new Text('A-Z');
     $this->assertSame((string) $set, 'A-Z');
 }