Skip to content

Commit

Permalink
Added tests for the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Feb 20, 2016
1 parent 13c1e58 commit 5a00dae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Tests/Controller/CustomMenuTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,26 @@ public function testMenuIcons()
);
}

public function testMenuTargets()
{
$crawler = $this->getBackendHomepage();

$this->assertEquals(
'_blank',
$crawler->filter('.sidebar-menu li:contains("Project Home") a')->attr('target')
);

$this->assertEquals(
'_self',
$crawler->filter('.sidebar-menu li:contains("Documentation") a')->attr('target')
);

$this->assertEquals(
'arbitrary_value',
$crawler->filter('.sidebar-menu li:contains("Report Issues") a')->attr('target')
);
}

public function testMenuUrls()
{
$crawler = $this->getBackendHomepage();
Expand Down
6 changes: 3 additions & 3 deletions Tests/Fixtures/App/config/config_custom_menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ easy_admin:
- { label: 'Images', entity: 'Image' }
- { label: 'Purchases', entity: 'Purchase', icon: '', params: { sortField: 'deliveryDate' } }
- { label: 'About EasyAdmin' }
- { label: 'Project Home', url: 'https://github.com/javiereguiluz/EasyAdminBundle', icon: 'home' }
- { label: 'Documentation', url: 'https://github.com/javiereguiluz/EasyAdminBundle#getting-started-guide', icon: 'book' }
- { label: 'Report Issues', url: 'https://github.com/javiereguiluz/EasyAdminBundle/issues', icon: 'github' }
- { label: 'Project Home', url: 'https://github.com/javiereguiluz/EasyAdminBundle', icon: 'home', target: '_blank' }
- { label: 'Documentation', url: 'https://github.com/javiereguiluz/EasyAdminBundle#getting-started-guide', icon: 'book', target: '_self' }
- { label: 'Report Issues', url: 'https://github.com/javiereguiluz/EasyAdminBundle/issues', icon: 'github', target: 'arbitrary_value' }

0 comments on commit 5a00dae

Please sign in to comment.