Skip to content
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

Failing test for issue #657 (calling find before flush) #665

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

dantleech
Copy link
Contributor

Failing test for issue #657

@dantleech
Copy link
Contributor Author

Note that this does not currently address the same problem which this case was designed to reproduce (in routing auto. In that issue one of the fields caused an undefined index error.

I tried to fix this in a few ways yesterday, but I think there may be more than one issue that needs to be overcome.


$article->topic = 'Bonjour le monde!';
$this->dm->bindTranslation($article, 'fr');
$articleInstance = $this->dm->findTranslation(get_class($article), '/functional/article-1', 'en');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be the same object as $article. not sure if we should assign in this case. if we have no test about that, maybe assertSame($article, $articleInstance).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was trying to illustrate the problrem, but yeah, pointlesss.

On 9 October 2015 16:45:53 BST, David Buchmann notifications@github.com wrote:

  • /**
  • \* It should be able to find a bound translation before flush.
    
  • */
    
  • public function testRetainTranslation()
  • {
  •    $article = new Article;
    
  •    $article->id = '/functional/article-1';
    
  •    $article->text = 'Foo';
    
  •    $this->dm->persist($article);
    
  •    $article->topic = 'Hello everybody!';
    
  •    $this->dm->bindTranslation($article, 'en');
    
  •    $article->topic = 'Bonjour le monde!';
    
  •    $this->dm->bindTranslation($article, 'fr');
    
  •    $articleInstance =
    
    $this->dm->findTranslation(get_class($article),
    '/functional/article-1', 'en');

this will be the same object as $article. not sure if we should assign
in this case. if we have no test about that, maybe assertSame($article,
$articleInstance).


Reply to this email directly or view it on GitHub:
https://github.com/doctrine/phpcr-odm/pull/665/files#r41645115

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@dbu
Copy link
Member

dbu commented Oct 9, 2015

i agree that this should work like the test describes it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants