-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
139 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\ODM\PHPCR\Event; | ||
|
||
use Doctrine\Common\Persistence\ObjectManager; | ||
use Doctrine\Common\Persistence\Event\ManagerEventArgs as BaseManagerEventArgs; | ||
|
||
class ManagerEventArgs extends BaseManagerEventArgs | ||
{ | ||
/** | ||
* @deprecated Will be dropped in favor of getObjectManager in 1.0 | ||
* @return \Doctrine\ODM\PHPCR\DocumentManager | ||
*/ | ||
public function getDocumentManager() | ||
{ | ||
return $this->getObjectManager(); | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
tests/Doctrine/Tests/ODM/PHPCR/Event/LifecycleEventArgsTest.php
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,32 @@ | ||
<?php | ||
|
||
use Doctrine\ODM\PHPCR\Event\LifecycleEventArgs; | ||
|
||
class LifecycleEventArgsTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->dm = $this->getMockBuilder('Doctrine\ODM\PHPCR\DocumentManager') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->object = new \stdClass; | ||
|
||
$this->eventArgs = new LifecycleEventArgs( | ||
$this->object, | ||
$this->dm | ||
); | ||
} | ||
|
||
public function testGetDocumentManager() | ||
{ | ||
$res = $this->eventArgs->getDocumentManager(); | ||
$this->assertSame($this->dm, $res); | ||
} | ||
|
||
public function testGetDocument() | ||
{ | ||
$res = $this->eventArgs->getDocument(); | ||
$this->assertSame($this->object, $res); | ||
} | ||
} | ||
|
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
46 changes: 46 additions & 0 deletions
46
tests/Doctrine/Tests/ODM/PHPCR/Event/MoveEventArgsTest.php
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 | ||
|
||
use Doctrine\ODM\PHPCR\Event\MoveEventArgs; | ||
|
||
class MoveEventArgsTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function setUp() | ||
{ | ||
$this->dm = $this->getMockBuilder('Doctrine\ODM\PHPCR\DocumentManager') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->object = new \stdClass; | ||
|
||
$this->eventArgs = new MoveEventArgs( | ||
$this->object, | ||
$this->dm, | ||
'source/path', | ||
'target/path' | ||
); | ||
} | ||
|
||
public function testGetDocumentManager() | ||
{ | ||
$res = $this->eventArgs->getDocumentManager(); | ||
$this->assertSame($this->dm, $res); | ||
} | ||
|
||
public function testGetDocument() | ||
{ | ||
$res = $this->eventArgs->getDocument(); | ||
$this->assertSame($this->object, $res); | ||
} | ||
|
||
public function testGetSourcePath() | ||
{ | ||
$path = $this->eventArgs->getSourcePath(); | ||
$this->assertEquals('source/path', $path); | ||
} | ||
|
||
public function testGetTargetPath() | ||
{ | ||
$path = $this->eventArgs->getTargetPath(); | ||
$this->assertEquals('target/path', $path); | ||
} | ||
} | ||
|