[wip] fix namespace to follow convention (PHPCR-42) #133

Merged
merged 1 commit into from Apr 16, 2012

Conversation

Projects
None yet
2 participants
Contributor

cordoval commented Apr 15, 2012

hi @dbu, @lsmith, @Ocramius i gave thought to this and did some corrections #133
however I am totally disoriented as i see two Mapping folders as follows:

  1. https://github.com/doctrine/phpcr-odm/tree/master/tests/Doctrine/Tests/ODM/PHPCR/Functional/Mapping
    There is only 1 class here with a TODO which i found not very clear about what to do next
  2. https://github.com/doctrine/phpcr-odm/tree/master/tests/Doctrine/Tests/ODM/PHPCR/Mapping
    These set of classes was already refactored by someone else before I came in and I guess the work is done

I check the coverage as you said on the annotation driver class so it basically lacks the lifecycle callbacks usage, but where to put these tests in as i am confused

     160               0 :                     if ($annot instanceof ODM\PrePersist) {                                                          
     161               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::prePersist);                      
     162               0 :                     } elseif ($annot instanceof  ODM\PostPersist) {                                                  
     163               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::postPersist);                     
     164               0 :                     } elseif ($annot instanceof ODM\PreUpdate) {                                                     
     165               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::preUpdate);                       
     166               0 :                     } elseif ($annot instanceof ODM\PostUpdate) {                                                    
     167               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::postUpdate);                      
     168               0 :                     } elseif ($annot instanceof ODM\PreRemove) {                                                     
     169               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::preRemove);                       
     170               0 :                     } elseif ($annot instanceof ODM\PostRemove) {                                                    
     171               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::postRemove);                      
     172               0 :                     } elseif ($annot instanceof  ODM\PostLoad) {                                                     
     173               0 :                         $metadata->addLifecycleCallback($method->getName(), Event::postLoad);                        
     174               0 :                     }                                                                                                

Also i am not very familiar with the schema of the annotation driver how to test so any explanation or help pointers would be great, thanks

@lsmith77 lsmith77 added a commit that referenced this pull request Apr 16, 2012

@lsmith77 lsmith77 Merge pull request #133 from cordoval/feature/refactorMappingTests
[wip] fix namespace to follow convention (PHPCR-42)
7cfe1db

@lsmith77 lsmith77 merged commit 7cfe1db into doctrine:master Apr 16, 2012

Member

lsmith77 commented Apr 16, 2012

the tests are split up by "unit" and "functional tests. the first make use of mock objects to test specific aspects, while the functional tests setup a proper ODM instance with a real running server etc.

in general whatever you can test with a limited number of mock objects should be tested with unit tests, everything else with functional tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment