Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.1' into 1.2
Browse files Browse the repository at this point in the history
Conflicts:
	composer.json
  • Loading branch information
dbu committed Apr 5, 2015
2 parents 320c840 + 3999da4 commit 67fb147
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
"minimum-stability": "dev",
"require": {
"php": ">=5.3.3",
"doctrine/common": "~2.4.0",
"doctrine/common": "~2.4",
"phpcr/phpcr": "~2.1.1",
"phpcr/phpcr-implementation": "~2.1.0",
"phpcr/phpcr-utils": "~1.1",
"doctrine/instantiator": "~1.0.1"
},
"require-dev": {
"symfony/yaml": "~2.0",
"symfony/phpunit-bridge": "2.7.*@dev",
"liip/rmt": "~1.1"
},
"suggest":{
Expand Down
6 changes: 5 additions & 1 deletion lib/Doctrine/ODM/PHPCR/Mapping/Driver/YamlDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Doctrine\Common\Persistence\Mapping\Driver\FileDriver;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException;
use Doctrine\ODM\PHPCR\Mapping\MappingException;
use Doctrine\Common\Persistence\Mapping\MappingException as DoctrineMappingException;
use Symfony\Component\Yaml\Yaml;
Expand Down Expand Up @@ -270,7 +271,10 @@ private function addMappingFromReference(ClassMetadata $class, $fieldName, $refe
*/
protected function loadMappingFile($file)
{
return Yaml::parse($file);
if (!is_file($file)) {
throw new InvalidArgumentException(sprintf('File "%s" not found', $file));
}
return Yaml::parse(file_get_contents($file));
}

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
throw new RuntimeException('Install dependencies to run test suite.');
}

$files = array_filter(array(
__DIR__.'/../vendor/symfony/symfony/src/Symfony/Bridge/PhpUnit/bootstrap.php',
__DIR__.'/../vendor/symfony/phpunit-bridge/bootstrap.php',
), 'file_exists');
if ($files) {
require_once current($files);
}

use Doctrine\Common\Annotations\AnnotationRegistry;
AnnotationRegistry::registerLoader(array($autoload, 'loadClass'));
AnnotationRegistry::registerFile(__DIR__.'/../lib/Doctrine/ODM/PHPCR/Mapping/Annotations/DoctrineAnnotations.php');
Expand Down

0 comments on commit 67fb147

Please sign in to comment.