[wp-trac] [WordPress Trac] #22989: Translation units tests loading test data from non-dynamic path
WordPress Trac
noreply at wordpress.org
Tue Dec 18 09:07:45 UTC 2012
#22989: Translation units tests loading test data from non-dynamic path
-----------------------------+--------------------------
Reporter: mbijon | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Unit Tests
Version: 3.5 | Severity: normal
Keywords: has-patch |
-----------------------------+--------------------------
Many of the current translation (pomo) unit tests load test files from
paths not prefixed with DIR_TESTDATA.
The problems happen when the bootstrap.php file is located in a different
folder from the default. In that case the mentioned tests fail with errors
like {{{fopen(data/pomo/{filename}): failed to open stream: No such file
or directory}}}.
'''Reproducing this error'''
Default bootstrap location, tests succeed:
`www/test_svn/bootstrap.php`[[BR]]
`www/test_svn/tests/`[[BR]]
`www/test_svn/data/pomo/test_mo.php`
Tests fail when bootstrap is moved &/or executed by other files:
`www/visualphpunit/bootstrap.php`[[BR]]
`www/test_svn/tests/`[[BR]]
`www/test_svn/data/pomo/test_mo.php`
The attached patch prefixes all the offending tests with DIR_TESTDATA so
they can correctly locate the testdata even when the bootstrap is
relocated.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22989>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list