ZF-4582: Set of GData unit tests errors: 'failed to open stream: No such file or directory'

Issue Type: Unit Tests: Problem Created: 2008-10-13T01:52:09.000+0000 Last Updated: 2009-02-12T15:20:54.000+0000 Status: Closed Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Alexander Veremyev (alexander) Assignee: Wil Sinclair (wil) Tags: - Zend_Gdata

Related issues: Attachments:


{panel} 1) testToAndFromString(Zend_Gdata_Gbase_ItemFeedTest) file_get_contents(Zend/Gdata/Gbase/_files/TestDataGbaseItemFeedSample1.xml): failed to open stream: No such file or directory

  1. testToAndFromString(Zend_Gdata_Gbase_SnippetFeedTest) file_get_contents(Zend/Gdata/Gbase/_files/TestDataGbaseSnippetFeedSample1.xml): failed to open stream: No such file or directory

  2. testToAndFromString(Zend_Gdata_Spreadsheets_SpreadsheetFeedTest) file_get_contents(Zend/Gdata/Spreadsheets/_files/TestDataSpreadsheetFeedSample1.xml): failed to open stream: No such file or directory

  3. testToAndFromString(Zend_Gdata_Spreadsheets_WorksheetFeedTest) file_get_contents(Zend/Gdata/Spreadsheets/_files/TestDataWorksheetFeedSample1.xml): failed to open stream: No such file or directory

  4. testToAndFromString(Zend_Gdata_Spreadsheets_ListFeedTest) file_get_contents(Zend/Gdata/Spreadsheets/_files/TestDataListFeedSample1.xml): failed to open stream: No such file or directory

  5. testToAndFromString(Zend_Gdata_Docs_DocumentListFeedTest) file_get_contents(Zend/Gdata/Docs/_files/TestDataDocumentListFeedSample.xml): failed to open stream: No such file or directory {panel}


Posted by Trevor Johns (tjohns) on 2008-10-13T03:25:32.000+0000

I wasn't able to reproduce this on my end.

However, I'm going to try replacing the hard-coded pathnames with calls to dirname(FILE), or similar, and see if that fixes this problem for Alexander.

Posted by Thomas Weidner (thomas) on 2008-10-19T02:11:20.000+0000

Erased fix-version as issue is not fixed with this release

Posted by Ryan Boyd (rboyd) on 2008-10-19T10:54:59.000+0000

Hi Thomas,

Can you describe the environment from which you're running these tests? What directory are you running phpunit from?

When running phpunit from the root of the tests directory, this should work fine:

The function call used in these tests is like this example: file_get_contents('Zend/Gdata/Gbase/_files/TestDataGbaseItemFeedSample1.xml')

The files exist in the 'tests' directory-- example:…

I've always thought that the tests were supposed to be run from the root of the tests directory--- if that's not correct, we can tell file_get_contents to search the include path... but the root of the tests directory will need to be in the include path then too.


Thanks, -Ryan

Posted by Alexander Veremyev (alexander) on 2008-11-06T09:38:51.000+0000

Hi Ryan,

Tests are intended to be started from the root of tests directory. But it's also useful to run tests separately from their own directories sometimes.

So it's a good practice to use absolute paths based on current script directory (like dirname(__FILE__) . '_files/...')

Tests are passed correctly if they are started from root now. So issue should be closed If you don't plan to change existing code using full pathnames.

Posted by Wil Sinclair (wil) on 2008-11-07T11:44:39.000+0000

Fixed with Rev# 12350

Posted by Trevor Johns (tjohns) on 2009-02-12T15:20:54.000+0000

Marking as fixed for 1.7.0.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.