-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark page as edited on batch block deleting (#689)
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata Project 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\PageBundle\Tests\Admin; | ||
|
||
use Sonata\PageBundle\Tests\Helpers\PHPUnit_Framework_TestCase; | ||
|
||
class BaseBlockAdminTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testSettingAsEditedOnPreBatchDeleteAction() | ||
{ | ||
$page = $this->createMock('Sonata\PageBundle\Model\PageInterface'); | ||
$page->expects($this->once())->method('setEdited')->with(true); | ||
|
||
$parent = $this->createMock('Sonata\AdminBundle\Admin\AdminInterface'); | ||
$parent->expects($this->once())->method('getSubject')->will($this->returnValue($page)); | ||
|
||
$blockAdmin = $this->getMockBuilder('Sonata\PageBundle\Admin\BaseBlockAdmin') | ||
->disableOriginalConstructor() | ||
->getMockForAbstractClass(); | ||
$blockAdmin->setParent($parent); | ||
|
||
$query = $this->createMock('Sonata\AdminBundle\Datagrid\ProxyQueryInterface'); | ||
$idx = array(); | ||
$blockAdmin->preBatchAction('delete', $query, $idx, true); | ||
} | ||
} |