- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 290
 
[WIP] Improved conversion for aliased classnames #351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Before: ```MyEntityNamespace:Foo:Bar``` resolves (silently) to ```MyEntityNamespace:Foo``` After: ```MyEntityNamespace:Foo:Bar``` throws ```\InvalidArgumentException``` | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none
| 
           Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DCOM-270 We use Jira to track the state of pull requests and the versions they got  | 
    
          
 
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that explode() has a third $limit argument (see http://3v4l.org/as2I7), maybe that's a better solution here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @Ocramius, thank you for the tip.
I updated the PR with this change.
… explode() limit to 2). * Added test.
| 
           Yes @Ocramius, of course  Now I need some hint in order to finish the 2nd and 3rd item.  | 
    
| 
           Tests for   | 
    
| 
           Sure, this is the reason of the updated title with "[WIP]" prepended; but I tried to add a test for  Test: public function testInvalidClassIsTransient()
{
    $this->setExpectedException(
        'Doctrine\Common\Persistence\Mapping\MappingException',
        'Class \'Doctrine\Tests\Common\Persistence\Mapping\ChildEntity:Foo\' does not exist'
    );
    $this->cmf->isTransient('prefix:ChildEntity:Foo');
}results in:  | 
    
| 
           @phansys should just report   | 
    
| 
           Perfect @Ocramius, I will add a test for this case with that assert.  | 
    
…Registry::getManagerForClass().
| 
           @phansys thanks for providing tests. I'll review and merge manually after fixing nitpickery myself.  | 
    
| 
           You're welcome @Ocramius!  | 
    
[WIP] Improved conversion for aliased classnames
| 
           Merged, thanks!  | 
    
Improved conversion for aliased classnames
Before:
Doctrine\Tests\Common\Persistence\Mapping:ChildEntity:Fooresolves (silently) toDoctrine\Tests\Common\Persistence\Mapping\ChildEntityAfter:
Doctrine\Tests\Common\Persistence\Mapping:ChildEntity:Fooresolves toDoctrine\Tests\Common\Persistence\Mapping\ChildEntity:Fooin order to get validation in lower layers.TODO: