[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    Re: [PEAR-CVS] cvs: pear /Net_UserAgent_Mobile/Mobile DoCoMo.php
From:       KUBO Atsuhiro <kubo () iteman ! jp>
Date:       2009-05-25 10:16:05
Message-ID: bf7311b70905250316j2d9d5a74m63a80dcce58965f7 () mail ! gmail ! com
[Download RAW message or body]

Hi Daniel,

Sorry, I've overlooked your mail.

So,

2009/5/25 Daniel O'Connor <daniel.oconnor@gmail.com>:
>>
>> I don't suppose you missed some files?
>>
>> Unit tests now produce:
>> clockwerx@clockwerx-desktop:~/pear/Net_UserAgent_Mobile$ php
>> tests/AllTests.php
>> PHPUnit 3.3.16 by Sebastian Bergmann.
>>
>> .................EE.............F..
>> Fatal error: Call to undefined method
>> Net_UserAgent_Mobile_DoCoMo::getBrowserVersion() in
>> /home/clockwerx/pear/Net_UserAgent_Mobile/tests/Mobile/DoCoMoTestCase.php on
>> line 1829

At the present time, no fatal errors are raised by the following command:

$ pwd
/home/iteman/CVSWORK/pear
$ ls -l
total 24
-rw-r--r-- 1 iteman iteman 16109 Dec 30 00:24 AllTests.php
drwxr-xr-x 2 iteman iteman  4096 May 25 18:11 CVS/
drwxr-xr-x 6 iteman iteman  4096 May 25 18:11 Net_UserAgent_Mobile/
$ phpunit PEAR_AllTests AllTests.php
PHPUnit 3.3.16 by Sebastian Bergmann.

............................................................. 60 / 67
........

Time: 1 second

OK (67 tests, 23531 assertions)

Of course, in the Net_UserAgent_Mobile directory, tests does not work
because of the directory structure as you suggested.

$ pwd
/home/iteman/CVSWORK/pear/Net_UserAgent_Mobile
$ php tests/AllTests.php

Warning: require_once(Net/UserAgent/Mobile.php): failed to open
stream: No such file or directory in
/home/iteman/CVSWORK/pear/Net_UserAgent_Mobile/tests/MobileTestCase.php
on line 41

Fatal error: require_once(): Failed opening required
'Net/UserAgent/Mobile.php' (include_path='.:...') in
/home/iteman/CVSWORK/pear/Net_UserAgent_Mobile/tests/MobileTestCase.php
on line 41

There are my questions:

1. Should tests work in individual directories?

2. If tests should work in individual directories, what's the best way to do it?

 3. To change the directory structure will cause many CVS logs to be
lost. Even so, should I do it?

 4. To load files previously in AllTests.php (eg. PHP_CodeSniffer)
will be OK, but tests for file loading will not be able to do. Even
so?

 5. To create symbolik links such like AllTests.php in the top level
will be OK, but I don't think that it is significant.

>> Nevermind, this was a conflict between the installed version and the CVS
> version, because of the directory structure.
>
> So; two problems:
> 1) CVS directory structure is 'wrong' for unit tests to run
> Ideally, in CVS, it would be:
> ~/pear-cvs/pear/Net_UserAgent_Mobile/Net/UserAgent/Mobile.php instead of the
> current structure.
>
> so when you are in
> ~/pear-cvs/pear/Net_UserAgent_Mobile/
>
> your include path of "." wins.

About this, I mentioned above.

> 2) Error.php installs to the wrong location. (fix package.xml or change you
> directory structure and regenerate it)
> pear list Net_UserAgent_Mobile:
> php  /usr/share/php/Net/UserAgent/Mobile/DoCoMo.php
> *php  /usr/share/php/Mobile/Error.php*
>
> which means:
>
> clockwerx@clockwerx-desktop:~/pear/Net_UserAgent_Mobile$ php
> tests/AllTests.php
>
> *Warning: require_once(Net/UserAgent/Mobile/Error.php): failed to open
> stream: No such file or directory in /usr/share/php/Net/UserAgent/Mobile.php
> on line 40*

Currently, Error.php will be installed to the right location.

Thanks,

-- 
KUBO Atsuhiro e-mail: kubo@iteman.jp

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic