Example #1
0
 /**
  * @covers ::__get
  */
 public function test_get()
 {
     # Status
     $this->assertAttributeSame($this->Stream->Status, '_Status', $this->Stream, 'IObject::$Status should equal IObject::_Status');
     # Serializer
     $this->assertSame($this->Stream->Serializer, $this->Stream->getSerializer(), 'IObject::$Serializer should equal IObject::getSerializer()');
     # Parent
     $this->assertNULL($this->Stream->Parent, 'IObject::$Parent should initially be NULL');
     # ID
     $this->assertSame($this->Stream->ID, $this->Stream->getID(), 'IObject::$ID should equal IObject::getID()');
     # fp
     $this->assertTrue(is_resource($this->Stream->fp), 'IStream::$fp should be a resource');
     # Flags
     $this->assertTrue(is_int($this->Stream->Flags), 'IStream::$Flags should be an integer');
     # Options
     $this->assertTrue(is_array($this->Stream->Options), 'IStream::$Options should be an array');
     # Test undefined property
     try {
         $this->Stream->undefined;
         $this->fail('Failed to generate notice with undefined property');
     } catch (\PHPUnit_Framework_Error_Notice $e) {
         $this->assertContains('Undefined property', $e->getMessage(), 'Invalid notice: ' . $e->getMessage());
     }
     @$this->Stream->undefined;
 }