public function testGetPageFlexFormSource()
{
$record1 = array('pid' => 2, 'uid' => 1);
$record2 = array('pid' => 0, 'uid' => 3, 'tx_fed_page_flexform' => 'test');
/** @var WorkspacesAwareRecordService|\PHPUnit_Framework_MockObject_MockObject $service */
$service = $this->getMock('FluidTYPO3\\Flux\\Service\\WorkspacesAwareRecordService', array('getSingle'));
$service->expects($this->at(0))->method('getSingle')->with('pages', '*', 1)->willReturn($record1);
$service->expects($this->at(1))->method('getSingle')->with('pages', '*', 2)->willReturn($record2);
$instance = new PageService();
$instance->injectWorkspacesAwareRecordService($service);
$output = $instance->getPageFlexFormSource(1);
$this->assertEquals('test', $output);
}