Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1135

ExamplesTest broken when xdebug is enabled

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.16.0
    • Affects Version/s: None
    • Component/s: Tests

      ExamplesTest makes assertion on var_dump output, but xdebug modifies this output.

      Solution : use an other dumping function, like var_export.

      --- Expected
      +++ Actual
      @@ @@
      -object(MongoDB\Examples\TypeMapEntry)#%d (%d) {
      -  ["id":"MongoDB\Examples\TypeMapEntry":private]=>
      -  object(MongoDB\BSON\ObjectId)#%d (%d) {
      -    ["oid"]=>
      -    string(24) "%s"
      +/Users/jerome/Develop/mongo-php-library/examples/typemap.php:120:
      +class MongoDB\Examples\TypeMapEntry#7 (3) {
      +  private $id =>
      +  class MongoDB\BSON\ObjectId#43 (1) {
      +    public $oid =>
      +    string(24) "6464a1913a4af41b2f0a7614"
         }
      -  ["name":"MongoDB\Examples\TypeMapEntry":private]=>
      +  private $name =>
         string(7) "alcaeus"
      -  ["emails":"MongoDB\Examples\TypeMapEntry":private]=>
      +  private $emails =>
         array(2) {
      -    [0]=>
      -    object(MongoDB\Examples\TypeMapEmail)#%d (%d) {
      -      ["type":"MongoDB\Examples\TypeMapEmail":private]=>
      +    [0] =>
      +    class MongoDB\Examples\TypeMapEmail#46 (2) {
      +      private $type =>
             string(4) "work"
      -      ["address":"MongoDB\Examples\TypeMapEmail":private]=>
      +      private $address =>
             string(19) "alcaeus@example.com"
           }
      -    [1]=>
      -    object(MongoDB\Examples\TypeMapEmail)#%d (%d) {
      -      ["type":"MongoDB\Examples\TypeMapEmail":private]=>
      +    [1] =>
      +    class MongoDB\Examples\TypeMapEmail#53 (2) {
      +      private $type =>
             string(7) "private"
      -      ["address":"MongoDB\Examples\TypeMapEmail":private]=>
      +      private $address =>
             string(18) "secret@example.com"
           }
         }
      -}
      +}

       

            Assignee:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Reporter:
            jerome.tamarelle@mongodb.com Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: