Permalink
Browse files

Fixed compatibility with Doctrine 2.2

  • Loading branch information...
1 parent b9156e9 commit dad9808db846dc38fc4f3019eb5c235765e978e3 @fprochazka fprochazka committed Mar 10, 2012
View
3 libs/Kdyby/Package/ComponentsPackage/ComponentsPackage.php
@@ -24,8 +24,9 @@ class ComponentsPackage extends Kdyby\Packages\Package
/**
* @param \Nette\Config\Configurator $config
* @param \Nette\Config\Compiler $compiler
+ * @param \Kdyby\Packages\PackagesContainer $packages
*/
- public function compile(Nette\Config\Configurator $config, Nette\Config\Compiler $compiler)
+ public function compile(Nette\Config\Configurator $config, Nette\Config\Compiler $compiler, Kdyby\Packages\PackagesContainer $packages)
{
// Kdyby Components
$compiler->addExtension('kc', new DI\ComponentsExtension);
View
2 tests/Kdyby/Tests/Components/Grinder/ColumnTest.php
@@ -302,7 +302,7 @@ private function mockGrid($value = NULL, $sortable = NULL)
->getMock();
$qb = $this->mockQueryBuilder();
- $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array(), array($qb, $doctrine));
+ $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array(), array($doctrine, $qb));
if ($value !== NULL) {
$grid->expects($this->once())
View
9 tests/Kdyby/Tests/Components/Grinder/Fixtures/RelatedEntity.php
@@ -11,31 +11,32 @@
namespace Kdyby\Tests\Components\Grinder\Fixtures;
use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ORM\Mapping as ORM;
use Kdyby;
use Nette;
/**
- * @Orm:Entity()
+ * @ORM\Entity()
* @author Filip Procházka <filip.prochazka@kdyby.org>
*/
class RelatedEntity extends Kdyby\Doctrine\Entities\IdentifiedEntity
{
/**
- * @Orm:Column(type="string")
+ * @ORM\Column(type="string")
*/
public $name;
/**
- * @Orm:ManyToOne(targetEntity="RootEntity", inversedBy="children", cascade={"persist"})
+ * @ORM\ManyToOne(targetEntity="RootEntity", inversedBy="children", cascade={"persist"})
* @var \Kdyby\Tests\Components\Grinder\Fixtures\RootEntity
*/
public $daddy;
/**
- * @Orm:ManyToMany(targetEntity="RootEntity", mappedBy="buddies", cascade={"persist"})
+ * @ORM\ManyToMany(targetEntity="RootEntity", mappedBy="buddies", cascade={"persist"})
* @var \Kdyby\Tests\Components\Grinder\Fixtures\RootEntity[]
*/
public $buddies;
View
11 tests/Kdyby/Tests/Components/Grinder/Fixtures/RootEntity.php
@@ -11,37 +11,38 @@
namespace Kdyby\Tests\Components\Grinder\Fixtures;
use Doctrine\Common\Collections\ArrayCollection;
+use Doctrine\ORM\Mapping as ORM;
use Kdyby;
use Nette;
/**
- * @Orm:Entity()
+ * @ORM\Entity()
* @author Filip Procházka <filip.prochazka@kdyby.org>
*/
class RootEntity extends Kdyby\Doctrine\Entities\IdentifiedEntity
{
/**
- * @Orm:Column(type="string")
+ * @ORM\Column(type="string")
*/
public $name;
/**
- * @Orm:ManyToOne(targetEntity="RelatedEntity", cascade={"persist"})
+ * @ORM\ManyToOne(targetEntity="RelatedEntity", cascade={"persist"})
* @var \Kdyby\Tests\Components\Grinder\Fixtures\RelatedEntity
*/
public $daddy;
/**
- * @Orm:OneToMany(targetEntity="RelatedEntity", mappedBy="daddy", cascade={"persist"})
+ * @ORM\OneToMany(targetEntity="RelatedEntity", mappedBy="daddy", cascade={"persist"})
* @var \Kdyby\Tests\Components\Grinder\Fixtures\RelatedEntity[]
*/
public $children;
/**
- * @Orm:ManyToMany(targetEntity="RelatedEntity", inversedBy="buddies", cascade={"persist"})
+ * @ORM\ManyToMany(targetEntity="RelatedEntity", inversedBy="buddies", cascade={"persist"})
* @var \Kdyby\Tests\Components\Grinder\Fixtures\RelatedEntity[]
*/
public $buddies;
View
2 tests/Kdyby/Tests/Components/Grinder/GridFiltersTest.php
@@ -176,7 +176,7 @@ private function mockGrid()
->getMock();
$qb = $this->mockQueryBuilder();
- $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array(), array($qb, $doctrine));
+ $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array(), array($doctrine, $qb));
$grid->expects($this->any())
->method('isColumnNameValid')
View
6 tests/Kdyby/Tests/Components/Grinder/GridFormTest.php
@@ -24,12 +24,12 @@ class GridFormTest extends Kdyby\Tests\OrmTestCase
public function testRecordIds()
{
- $form = new GridForm($this->mockDoctrine());
-
$grid = $this->mockGrid('getItemsPerPage');
$grid->expects($this->once())
->method('getItemsPerPage')
->will($this->returnValue(20));
+
+ $form = new GridForm($this->mockDoctrine(), $grid);
$form->setParent($grid, 'form');
$form->setRecordIds($ids = range(1, 40, 2));
@@ -62,7 +62,7 @@ private function mockGrid($methods = array(), Kdyby\Doctrine\Registry $doctrine
->disableOriginalConstructor()
->getMock();
- return $this->getMock('Kdyby\Components\Grinder\Grid', (array)$methods, array($qb, $doctrine));
+ return $this->getMock('Kdyby\Components\Grinder\Grid', (array)$methods, array($doctrine, $qb));
}
}
View
3 tests/Kdyby/Tests/Components/Grinder/GridTest.php
@@ -104,7 +104,7 @@ public function testAttached_callsConfigure()
->createQueryBuilder('e');
/** @var \PHPUnit_Framework_MockObject_MockObject|\Kdyby\Components\Grinder\Grid $grid */
- $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array('configure', 'configureFilters'), array($qb, $this->getDoctrine()));
+ $grid = $this->getMock('Kdyby\Components\Grinder\Grid', array('configure', 'configureFilters'), array($this->getDoctrine(), $qb));
$grid->expects($this->once())
->method('configure')
->with($this->isInstanceOf('Nette\Application\UI\Presenter'));
@@ -175,6 +175,7 @@ public function testIsColumnNameValid($columnName)
public function testGetIterator_alwaysReturnsSameInstance()
{
+ $this->attachToPresenter($this->grid);
$iterator = $this->grid->getIterator();
$this->assertSame($iterator, $this->grid->getIterator());
}

0 comments on commit dad9808

Please sign in to comment.