NextOutput ) === 0 ) { throw new InvalidPacketException( 'Buffer is empty', InvalidPacketException::BUFFER_EMPTY ); } $Buffer = new Buffer( ); $Buffer->Set( $this->NextOutput ); $this->NextOutput = ''; return $Buffer; } } class SourceQueryTests extends PHPUnit_Framework_TestCase { private $Socket; private $SourceQuery; public function setUpBeforeClass() { $this->Socket = new TestableSocket(); $this->SourceQuery = new SourceQuery( $this->Socket ); $this->SourceQuery->Connect( 1, 2 ); } /** * @dataProvider InfoProvider */ public function testGetInfo( $RawInput, $ExpectedOutput ) { $this->Socket->NextOutput = $RawInput; $RealOutput = $this->SourceQuery->GetInfo(); $this->assertEquals( $ExpectedOutput, $RealOutput ); } public function InfoProvider() { // read from Tests/Info/ folder } }