Skip to content

Commit

Permalink
Merge pull request #323 from alcaeus/fix-build
Browse files Browse the repository at this point in the history
Fix travis build
  • Loading branch information
alcaeus committed Oct 24, 2019
2 parents 09b1694 + 328484f commit f0ee99c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 48 deletions.
11 changes: 1 addition & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ php:
- 7.1
- 7.2
- 7.3
- nightly

matrix:
allow_failures:
- php: nightly

services: mongodb

Expand All @@ -23,11 +18,7 @@ before_install:

before_script:
- composer self-update
- composer install --prefer-source
- composer config "platform.ext-mongo" "1.6.16"
- composer require alcaeus/mongo-php-adapter
- composer require doctrine/mongodb-odm
- composer require jackalope/jackalope-doctrine-dbal doctrine/phpcr-odm
- composer install

script:
- ./vendor/bin/phpunit -v
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"require-dev": {
"doctrine/orm": "^2.5.4",
"doctrine/dbal": "^2.5.4",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^7.0",
"alcaeus/mongo-php-adapter": "^1.1",
"doctrine/mongodb-odm": "^1.3.0"
},
"suggest": {
"doctrine/orm": "For loading ORM fixtures",
Expand All @@ -36,5 +38,10 @@
},
"conflict": {
"doctrine/phpcr-odm": "<1.3.0"
},
"config": {
"platform": {
"ext-mongo": "1.6.16"
}
}
}
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="vendor/autoload.php"
>
<testsuites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function testExecuteTransaction()
$em = $this->getMockSqliteEntityManager();
$executor = new ORMExecutor($em);
$fixture = $this->getMockFixture();
$fixture->expects($this->once())
->method('load')
->with($em);
$executor->execute([$fixture], true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ private function getPurger()
*/
private function getDocumentManager()
{
$this->loadDocumentManagerClass();
if (!class_exists(DocumentManager::class)) {
$this->markTestSkipped('Missing doctrine/phpcr-odm');
}

return $this
->getMockBuilder(DocumentManager::class)
Expand All @@ -148,39 +150,4 @@ private function getMockFixture()
{
return $this->createMock(FixtureInterface::class);
}

/**
* Ensures that the {@see \Doctrine\ODM\PHPCR\DocumentManager} class exists
*/
private function loadDocumentManagerClass()
{

if (class_exists(DocumentManager::class)) {
return;
}

// hold my beer while I do some mocking
eval(
<<<'PHP'
namespace Doctrine\ODM\PHPCR;
class DocumentManager implements \Doctrine\Common\Persistence\ObjectManager
{
public function find($className, $id) {}
public function persist($object) {}
public function remove($object) {}
public function merge($object) {}
public function clear($objectName = null) {}
public function detach($object) {}
public function refresh($object) {}
public function flush() {}
public function getRepository($className) {}
public function getClassMetadata($className) {}
public function getMetadataFactory() {}
public function initializeObject($obj) {}
public function contains($object) {}
}
PHP
);
}
}

0 comments on commit f0ee99c

Please sign in to comment.