[Halo] Add assert method to check for unset properties

Review Request #633 — Created Oct. 23, 2018 and submitted

pprkut
Lunr.Halo
634
337eece...
lunr

Add assert method to check for unset properties

Unit tests

  • 0
  • 0
  • 1
  • 1
  • 2
Description From Last Updated
pprkut
smillernl
  1. 
      
  2. src/Lunr/Halo/LunrBaseTest.php (Diff revision 2)
     
     

    shouldn't this be snake_case?

    1. it's like this to be in line with phpunit asserts and the existing asserts in LunrBaseTest

  3. 
      
smillernl
  1. Ship It!
  2. 
      
tardypad
  1. 
      
  2. src/Lunr/Halo/LunrBaseTest.php (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    Not sure I understand correctly all this but if I try to get what is happening here, I feel like using

    try
    {
        $property = $this->get_accessible_reflection_property($property);
        $property->getValue($this->class);
    }
    catch(Throwable $e)
    {
        $this->assertContains("Cannot access", $e->getMessage());
    }
    

    should be enough, no?

    1. I had that before. Unfortunately that neither catches the (old) success case nor the expected failure

  3. 
      
pprkut
tardypad
  1. Ship It!
  2. 
      
pprkut
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master

Loading...