forked from sonata-project/SonataAdminBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ShowMapperTest, BaseMapperTest, BaseGroupedMapperTest
Changed AdminInterface: added some new methods.
- Loading branch information
1 parent
9d7591a
commit 0c1c26b
Showing
6 changed files
with
340 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Tests\Mapper; | ||
|
||
use Sonata\AdminBundle\Mapper\BaseGroupedMapper; | ||
|
||
/** | ||
* Test for BaseGroupedMapper | ||
* | ||
* @author Andrej Hudec <[email protected]> | ||
*/ | ||
class BaseGroupedMapperTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var BaseGroupedMapper | ||
*/ | ||
protected $baseGroupedMapper; | ||
|
||
public function setUp() | ||
{ | ||
$admin = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface'); | ||
$builder = $this->getMock('Sonata\AdminBundle\Builder\BuilderInterface'); | ||
|
||
$this->baseGroupedMapper = $this->getMockForAbstractClass('Sonata\AdminBundle\Mapper\BaseGroupedMapper', array($builder, $admin)); | ||
} | ||
|
||
public function testWith() | ||
{ | ||
$this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup')); | ||
} | ||
|
||
public function testEnd() | ||
{ | ||
$this->assertEquals($this->baseGroupedMapper, $this->baseGroupedMapper->with('fooGroup')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Tests\Mapper; | ||
|
||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
use Sonata\AdminBundle\Builder\BuilderInterface; | ||
use Sonata\AdminBundle\Mapper\BaseMapper; | ||
|
||
/** | ||
* Test for BaseMapperTest | ||
* | ||
* @author Andrej Hudec <[email protected]> | ||
*/ | ||
class BaseMapperTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var BaseMapper | ||
*/ | ||
protected $baseMapper; | ||
|
||
/** | ||
* @var AdminInterface | ||
*/ | ||
protected $admin; | ||
|
||
public function setUp() | ||
{ | ||
$this->admin = $this->getMock('Sonata\AdminBundle\Admin\AdminInterface'); | ||
$builder = $this->getMock('Sonata\AdminBundle\Builder\BuilderInterface'); | ||
|
||
$this->baseMapper = $this->getMockForAbstractClass('Sonata\AdminBundle\Mapper\BaseMapper', array($builder, $this->admin)); | ||
} | ||
|
||
public function testGetAdmin() | ||
{ | ||
$this->assertEquals($this->admin, $this->baseMapper->getAdmin()); | ||
} | ||
} |
Oops, something went wrong.