|
@@ -1747,6 +1747,26 @@ class AdminTest extends \PHPUnit_Framework_TestCase
|
|
|
$this->assertSame($menu, $admin->buildBreadcrumbs($action, $menu));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * NEXT_MAJOR: remove this method.
|
|
|
+ *
|
|
|
+ * @group legacy
|
|
|
+ */
|
|
|
+ public function testCreateQueryLegacyCallWorks()
|
|
|
+ {
|
|
|
+ $admin = $this->getMockForAbstractClass('Sonata\AdminBundle\Admin\AbstractAdmin', array(
|
|
|
+ 'admin.my_code', 'My\Class', 'MyBundle:ClassAdmin',
|
|
|
+ ));
|
|
|
+ $modelManager = $this->getMock('Sonata\AdminBundle\Model\ModelManagerInterface');
|
|
|
+ $modelManager->expects($this->once())
|
|
|
+ ->method('createQuery')
|
|
|
+ ->with('My\Class')
|
|
|
+ ->willReturn('a query');
|
|
|
+
|
|
|
+ $admin->setModelManager($modelManager);
|
|
|
+ $this->assertSame('a query', $admin->createQuery('list'));
|
|
|
+ }
|
|
|
+
|
|
|
private function createTagAdmin(Post $post)
|
|
|
{
|
|
|
$postAdmin = $this->getMockBuilder('Sonata\AdminBundle\Tests\Fixtures\Admin\PostAdmin')
|