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 setUp() { $this->Socket = new TestableSocket(); $this->SourceQuery = new SourceQuery( $this->Socket ); $this->SourceQuery->Connect( 1, 2 ); } public function tearDown() { $this->SourceQuery->Disconnect(); } /** * @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 } }