1212namespace JavierEguiluz \Bundle \EasyAdminBundle \Tests \Controller ;
1313
1414use JavierEguiluz \Bundle \EasyAdminBundle \Tests \Fixtures \AbstractTestCase ;
15+ use Symfony \Component \HttpKernel \Kernel ;
1516
1617class DisabledActionsTest extends AbstractTestCase
1718{
@@ -24,17 +25,25 @@ public function setUp()
2425
2526 public function testAssociationLinksInListView ()
2627 {
28+ if (2 === Kernel::MAJOR_VERSION && 3 === Kernel::MINOR_VERSION ) {
29+ $ this ->markTestSkipped ('This test is not compatible with Symfony 2.3. ' );
30+ }
31+
2732 $ crawler = $ this ->requestListView ('Purchase ' );
2833
2934 $ this ->assertSame (
30- 'user11 ' ,
35+ 'user1 ' ,
3136 trim ($ crawler ->filter ('td[data-label="Buyer"] ' )->first ()->html ()),
3237 'The "buyer" field in the "list" view of the "Purchase" item does not contain a link because the "show" action is disabled for the "User" entity. '
3338 );
3439 }
3540
3641 public function testAssociationLinksInShowView ()
3742 {
43+ if (2 === Kernel::MAJOR_VERSION && 3 === Kernel::MINOR_VERSION ) {
44+ $ this ->markTestSkipped ('This test is not compatible with Symfony 2.3. ' );
45+ }
46+
3847 // 'Purchase' entity 'id' is generated randomly. In order to browse the
3948 // 'show' view of the first 'Purchase' entity, browse the 'list' view
4049 // and get the 'id' from the first row of the listing
@@ -43,8 +52,8 @@ public function testAssociationLinksInShowView()
4352 $ crawler = $ this ->requestShowView ('Purchase ' , $ firstPurchaseId );
4453
4554 $ this ->assertSame (
46- 'user11 ' ,
47- trim ($ crawler ->filter ('.field-association:contains("Buyer") .form-control ' )->html ()),
55+ 'user1 ' ,
56+ trim ($ crawler ->filter ('.field-association:contains("Buyer") .form-control ' )->first ()-> html ()),
4857 'The "buyer" field in the "show" view of the "Purchase" item does not contain a link because the "show" action is disabled for the "User" entity. '
4958 );
5059 }
0 commit comments