public function testVisitResult() { $result = ResultsObject::create([]); $this->extension->visitResult(DatagridConfiguration::create([]), $result); $this->assertArrayHasKey('metadata', $result); $this->assertInternalType('array', $result['metadata']); }
/** * {@inheritDoc} */ public function getData() { /** @var array $rows */ $rows = $this->getAcceptedDatasource()->getResults(); $result = ResultsObject::create(['data' => $rows]); $this->acceptor->acceptResult($result); return $result; }
/** * Test method acceptResult */ public function testAcceptResults() { $result = ResultsObject::create([]); $extMock = $this->getMockForAbstractClass('Oro\\Bundle\\DataGridBundle\\Extension\\ExtensionVisitorInterface'); $extMock->expects($this->once())->method('visitResult')->with($this->config, $result); $this->acceptor->addExtension($extMock); $this->acceptor->acceptResult($result); }
/** * @return ResultsObject */ protected function getTestResult() { return ResultsObject::create(['data' => [['id' => 1, 'name' => 'test1', 'wonCount' => 10], ['id' => 2, 'name' => 'test2', 'wonCount' => 4], ['id' => 3, 'name' => 'test3', 'wonCount' => 2], ['id' => 4, 'name' => 'test4', 'wonCount' => 6], ['id' => 5, 'name' => 'test5', 'wonCount' => 10], ['id' => 6, 'name' => 'test6', 'wonCount' => 9], ['id' => 7, 'name' => 'test7', 'wonCount' => 5], ['id' => 8, 'name' => 'test8', 'wonCount' => 4], ['id' => 9, 'name' => 'test9', 'wonCount' => 3], ['id' => 10, 'name' => 'test10', 'wonCount' => 2]], 'options' => ['totalRecords' => 14]]); }
/** * Empty implementation should be callable */ public function testVisitResult() { $result = ResultsObject::create([]); $config = DatagridConfiguration::create([]); $this->extension->visitResult($config, $result); }