Exemplo n.º 1
0
 /**
  * Test a simple read.
  *
  * @covers \Binary\Field\Text::read
  */
 public function testSimpleRead()
 {
     $field = new Text();
     $field->setSize($this->getMockedProperty(4));
     $field->setName('foo');
     $stream = $this->getMockedStringStream('barr');
     $dataSet = $this->getMock('\\Binary\\DataSet');
     $dataSet->expects($this->once())->method('setValue')->with($this->equalTo('foo'), $this->equalTo('barr'));
     $field->read($stream, $dataSet);
 }
Exemplo n.º 2
0
 public function testSimpleRead()
 {
     $field = new Text();
     $property = $this->getMockBuilder('\\Binary\\Field\\Property\\PropertyInterface')->getMock();
     $property->expects($this->any())->method('get')->will($this->returnValue(4));
     $field->setSize($property);
     $field->setName('foo');
     $stream = $this->getMock('\\Binary\\Stream\\StreamInterface');
     $stream->expects($this->any())->method('read')->will($this->returnValue('barr'));
     $dataSet = $this->getMock('\\Binary\\DataSet');
     $dataSet->expects($this->once())->method('setValue')->with($this->equalTo('foo'), $this->equalTo('barr'));
     $field->read($stream, $dataSet);
 }