The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
PostPosted: Mon Sep 21, 2009 4:11 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
I have winXP + wamp server 2.0i:

1. wamp root (done Image)
C:\wamp

2. wamp PHP (done Image)
C:\wamp\bin\php\php5.3.0

3. wamp PEAR (done Image)
C:\wamp\bin\php\php5.3.0\PEAR

4. PHPUnit 3.4.0 in 2 folders
C:\wamp\bin\php\php5.3.0\PEAR\PHPUnit
and
C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests

Next, I open CMD(command line)
#command1:
cd C:\wamp\bin\php\

//cause simple php doesn't work in global environment, it's a bug and haven't found the way to fix it even if to add it in win register

#command2:
--- php phpunit Alltests.php
// I asume that the file is in C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests

and then get the error:
Argument #1 of PHPUnit_Util_Fileloader:checkAndLoad() is no existing file

what is the problem? and how to fix it?


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 8:39 am 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10946
Location: Ireland
In Regards to PHPUnit have a look here:
http://docs.joomla.org/Unit_Testing

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 10:10 am 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
Where you able to make Unittesting work on wamp server? Cause I asume that unittesting is incompatible with wamp server.


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 10:52 am 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10946
Location: Ireland
No, I haven't tried it, but there are a few people who claim to work on WAMP with PHPUnit.
Did you ask the guys at the PHPUnit project?

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 11:21 am 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
ooffick wrote:
No, I haven't tried it, but there are a few people who claim to work on WAMP with PHPUnit.
Did you ask the guys at the PHPUnit project?

Olaf


I wish if phpunit had any forum like in joomla or any other opensource project but it doesn't and I can't dirrectly communicate with people who use this project.
I wrote a letter to Bergmann, but haven't got any answer yet.

I have spent few days with no luck trying to make it work,phpunit has a good guide about the testing itself, but the problem is just how to setup environment for it on winOS.


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 11:30 am 
User avatar
Joomla! Master
Joomla! Master
Online

Joined: Thu Jul 17, 2008 3:10 pm
Posts: 10946
Location: Ireland
There are a couple of tutorials which explain how to install phpunit on http://www.google.com/search?q=phpunit+wamp

Olaf

_________________
Olaf Offick - Global Moderator
http://learnskills.org


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 12:21 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
ooffick wrote:
There are a couple of tutorials which explain how to install phpunit on http://www.google.com/search?q=phpunit+wamp

Olaf


Will try to explain you one more time:
1. Yes I do have installed wamp->pear->phpunit. Yes I do have used google and searched a lot.
2. when I try to run phpunit it shows that it is installed. But when I try to run a test with phpunit
it gives an error which I mentioned above and I haven't found any solution for this.


Argument #1 of PHPUnit_Util_Fileloader:checkAndLoad() is no existing file
what is the problem? and how to fix it?


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 2:36 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
devlabs wrote:
ooffick wrote:
There are a couple of tutorials which explain how to install phpunit on http://www.google.com/search?q=phpunit+wamp

Olaf


Will try to explain you one more time:
1. Yes I do have installed wamp->pear->phpunit. Yes I do have used google and searched a lot.
2. when I try to run phpunit it shows that it is installed. But when I try to run a test with phpunit
it gives an error which I mentioned above and I haven't found any solution for this.


Argument #1 of PHPUnit_Util_Fileloader:checkAndLoad() is no existing file
what is the problem? and how to fix it?

Did you try adding your PHP and Pear directory to your path?

What tests are you trying to run?

Ian


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 3:17 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
ianmac wrote:
devlabs wrote:
ooffick wrote:
There are a couple of tutorials which explain how to install phpunit on http://www.google.com/search?q=phpunit+wamp

Olaf


Will try to explain you one more time:
1. Yes I do have installed wamp->pear->phpunit. Yes I do have used google and searched a lot.
2. when I try to run phpunit it shows that it is installed. But when I try to run a test with phpunit
it gives an error which I mentioned above and I haven't found any solution for this.


Argument #1 of PHPUnit_Util_Fileloader:checkAndLoad() is no existing file
what is the problem? and how to fix it?

Did you try adding your PHP and Pear directory to your path?

What tests are you trying to run?

Ian



before doing
#command2:
php phpunit Alltests.php

I do
#command1:
cd C:\wamp\bin\php\

so I am already in the php folder

I am trying to run some default test(if any) to see how it works.

C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests\Alltests.php


Code:
<?php

error_reporting(E_ALL | E_STRICT);

require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__);

require_once 'PHPUnit/Framework/TestSuite.php';
require_once 'PHPUnit/Extensions/PhptTestSuite.php';

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Framework' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Extensions' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Runner' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Util' . DIRECTORY_SEPARATOR . 'AllTests.php';

PHPUnit_Util_Filter::$filterPHPUnit = FALSE;


class AllTests
{
    public static function suite()
    {
        $suite = new PHPUnit_Framework_TestSuite('PHPUnit');

        $suite->addTest(Framework_AllTests::suite());
        $suite->addTest(Extensions_AllTests::suite());
        $suite->addTest(Runner_AllTests::suite());
        $suite->addTest(Util_AllTests::suite());
        $suite->addTest(new PHPUnit_Extensions_PhptTestSuite(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Regression'));
        $suite->addTest(new PHPUnit_Extensions_PhptTestSuite(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TextUI'));

        return $suite;
    }
}
?>


I asume that this should work.


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 3:35 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
devlabs wrote:
ianmac wrote:
Did you try adding your PHP and Pear directory to your path?

What tests are you trying to run?

Ian



before doing
#command2:
php phpunit Alltests.php

I do
#command1:
cd C:\wamp\bin\php\

so I am already in the php folder

I am trying to run some default test(if any) to see how it works.

C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests\Alltests.php


Code:
<?php

error_reporting(E_ALL | E_STRICT);

require_once 'PHPUnit/Util/Filter.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__);

require_once 'PHPUnit/Framework/TestSuite.php';
require_once 'PHPUnit/Extensions/PhptTestSuite.php';

require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Framework' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Extensions' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Runner' . DIRECTORY_SEPARATOR . 'AllTests.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Util' . DIRECTORY_SEPARATOR . 'AllTests.php';

PHPUnit_Util_Filter::$filterPHPUnit = FALSE;


class AllTests
{
    public static function suite()
    {
        $suite = new PHPUnit_Framework_TestSuite('PHPUnit');

        $suite->addTest(Framework_AllTests::suite());
        $suite->addTest(Extensions_AllTests::suite());
        $suite->addTest(Runner_AllTests::suite());
        $suite->addTest(Util_AllTests::suite());
        $suite->addTest(new PHPUnit_Extensions_PhptTestSuite(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Regression'));
        $suite->addTest(new PHPUnit_Extensions_PhptTestSuite(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'TextUI'));

        return $suite;
    }
}
?>


I asume that this should work.

Hmm... right now I'm only using the standard phpunit runner. I have a basic test like:

Code:
<?php
require_once 'PHPUnit/Framework.php';

class StackTest extends PHPUnit_Framework_TestCase
{
    public function testPushAndPop()
    {
        $stack = array();
        $this->assertEquals(0, count($stack));

        array_push($stack, 'foo');
        $this->assertEquals('foo', $stack[count($stack)-1]);
        $this->assertEquals(1, count($stack));

        $this->assertEquals('foo', array_pop($stack));
        $this->assertEquals(0, count($stack));
    }
}

That runs. I have that file in a folder called tests. I run it by doing:
phpunit tests

I haven't gotten into the complexities though that you are trying to wade through.

Ian


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 3:48 pm 
Joomla! Intern
Joomla! Intern

Joined: Fri Jan 23, 2009 10:39 pm
Posts: 54
ianmac wrote:
That runs. I have that file in a folder called tests. I run it by doing:
phpunit tests

I haven't gotten into the complexities though that you are trying to wade through.

Ian


Can you tell me the
1.full path to the file?
1.full path to the phpunit?
1.full path to the localhost website?

Is it
C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests\tests.php
or
C:\wamp\www\tests.php
or
it's in some another folder? where to create this file?


when you run in cmd
php phpunit
where is your location or it doesn't matter from what folder to run that command?


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 4:40 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
devlabs wrote:
ianmac wrote:
That runs. I have that file in a folder called tests. I run it by doing:
phpunit tests

I haven't gotten into the complexities though that you are trying to wade through.

Ian


Can you tell me the
1.full path to the file?
1.full path to the phpunit?
1.full path to the localhost website?

Is it
C:\wamp\bin\php\php5.3.0\tests\PHPUnit\PHPUnit\Tests\tests.php
or
C:\wamp\www\tests.php
or
it's in some another folder? where to create this file?


when you run in cmd
php phpunit
where is your location or it doesn't matter from what folder to run that command?

Well, I'm not on wamp server, so it may be different

I don't run php phpunit. I just run phpunit.

My full path to phpunit is /usr/bin/phpunit.

The localhost website doesn't matter, as PHPUnit doesn't run in the browser, it runs from the cli.

I would advise you to find your php executable and your phpunit executable and put those in your path. Then start working from there.

Ian


Top
 Profile  
 
PostPosted: Tue Sep 22, 2009 4:47 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
Try looking at:

http://jsdoodnauth.wordpress.com/2008/1 ... n-windows/

That may offer some assistance.

Ian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 



Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group