Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#393 closed defect (fixed)

PHP bindings test fail for checking valid geometry

Reported by: arsgeografica Owned by: csavage
Priority: trivial Milestone: 3.3.0
Component: SWIG Version: main
Severity: Annoyance Keywords: php phpunit
Cc:

Description

When compiling and testing the PHP bindings as laid out in http://crischan.net/blog/10/ the test runs, but fails with

1) test::testGeometry_checkValidity Undefined index: reason

when asserting that the "reason" key of the checkValidity result is null when used on a _valid_ geometry (lines 1267-1272).

Looking at php/geos.c lines 1182/1183 this seems right: the reason and location attributes are only created in the result array if the checked geometry is not valid. This test on a non-valid geometry (test.php 1274-1280) behaves as expected.

This seems sane behavior, but then the test.php should be adapted.

Attachments (1)

geos_php_test.patch (612 bytes ) - added by strk 13 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by arsgeografica, 13 years ago

Forgot to mention: This was tested using PHP 5.3.2 on Ubuntu 10.04 and 10.10.

by strk, 13 years ago

Attachment: geos_php_test.patch added

comment:2 by strk, 13 years ago

Could you please try the attached patch ?

comment:3 by strk, 13 years ago

Also, would you suggest a switch to enable that level of debugging when runnign the test ? See Makefile.am:

PHPOPTS = -n -d enable_dl=On -d extension_dir=$(abs_topbuilddir)/php/.libs

Some additional -d switch to raise debugging level would be nice

comment:4 by arsgeografica, 13 years ago

Resolution: fixed
Status: newclosed

All tests pass after applying the patch, thanks for that and sorry for not providing this myself. I am not sure about your last comment, do you want input from me on raising the debug level?

comment:5 by strk, 13 years ago

Yes, if you knew out of the box :) Or I'll have to go look it up...

comment:6 by strk, 13 years ago

r3169 has the fix, btw

Note: See TracTickets for help on using tickets.