Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Setup for running phpunit tests
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
marius  
View profile  
 More options Jul 18 2012, 11:14 pm
From: marius <mariu...@gmail.com>
Date: Wed, 18 Jul 2012 20:14:23 -0700 (PDT)
Local: Wed, Jul 18 2012 11:14 pm
Subject: Setup for running phpunit tests

Hi All,

Quick question running unit tests. The GCoS JS/CSS Media Compressor project is coming along nicely and we are about to implement some unit tests as well. The unit testing documents on the Joomla wiki, seem outdated therefore I am posting here.

In the bootstrap file the paths are defined as:

if (!defined('JPATH_TESTS'))
{
        define('JPATH_TESTS', realpath(__DIR__));

}

if (!defined('JPATH_PLATFORM'))
{
        define('JPATH_PLATFORM', realpath(dirname(JPATH_TESTS) . '/libraries'));

}

JPATH_PLATFORM is defined as the directory inside the test directory, but that library directory is empty. Do we need to manualy copy the platform in this directory?

Thanks, Marius


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Moffatt  
View profile  
 More options Jul 19 2012, 1:08 am
From: Sam Moffatt <pasa...@gmail.com>
Date: Wed, 18 Jul 2012 22:08:59 -0700
Local: Thurs, Jul 19 2012 1:08 am
Subject: Re: [jplatform] Setup for running phpunit tests
I'm not sure I understand. It should be a matter of getting PHPUnit
3.6, grabbing any dependencies (DBUnit primarily springs to mind
though I'm not sure if it's included) and just running "phpunit" in
the root directory of the platform instance. The dependencies can be a
bit of a trick however it'll give you error messages indicating
something you've missed that you can google.

On Wed, Jul 18, 2012 at 8:14 PM, marius <mariu...@gmail.com> wrote:
> JPATH_PLATFORM is defined as the directory inside the test directory, but that library directory is empty. Do we need to manualy copy the platform in this directory?

I'm not sure I understand the statement here. JPATH_PLATFORM is
defined as being in the libraries folder (/libraries) of the parent
directory of the tests folder (dirname(JPATH_TESTS)). I put some
var_dump's after each of the define lines and I got the following:

silversaviour:joomla-platform pasamio$ php tests/bootstrap.php
string(55) "/Users/pasamio/Sites/research/git/joomla-platform/tests"
string(59) "/Users/pasamio/Sites/research/git/joomla-platform/libraries"

So the tests directory is the tests directory and the libraries
directory is the libraries directory. The Joomla Platform should be
inside the libraries directory as indicated here and maps to the
following location (at least in my GIT checkout):
https://github.com/joomla/joomla-platform/tree/master/libraries/

There is no library/libraries directory inside the tests directory. My
copy of the "tests" directory reflects this version as shown on the
web:
https://github.com/joomla/joomla-platform/tree/master/tests

What happens when you run phpunit in the root directory of the
platform? Does your repository structure on disk reflect the structure
on the GitHub website?

Cheers,

Sam Moffatt
http://pasamio.id.au


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marius van Rijnsoever  
View profile  
 More options Jul 19 2012, 1:52 am
From: Marius van Rijnsoever <mariu...@gmail.com>
Date: Thu, 19 Jul 2012 13:52:40 +0800
Local: Thurs, Jul 19 2012 1:52 am
Subject: Re: [jplatform] Setup for running phpunit tests
Thanks for the reply Sam. Running it from the githib root directory
fixed that issue, but now I get the following errors:

Normal bootstrap
C:\xampp\php\php.exe C:\Users\htpc\AppData\Local\Temp\ide-phpunit.php
--bootstrap C:\PhpstormProjects\jfusion\jmedia\tests\bootstrap.php
--no-configuration C:\PhpstormProjects\jfusion\jmedia\
Fatal error: Class 'JApplicationHelper' not found in
C:\PhpstormProjects\jfusion\jmedia\tests\suites\legacy\application\JApplica tionHelperTest.php
on line 11

Legacy bootstrap
C:\xampp\php\php.exe C:\Users\htpc\AppData\Local\Temp\ide-phpunit.php
--bootstrap C:\PhpstormProjects\jfusion\jmedia\tests\bootstrap.legacy.php
--no-configuration C:\PhpstormProjects\jfusion\jmedia\
Fatal error: Class 'JApplicationCli' not found in
C:\PhpstormProjects\jfusion\jmedia\libraries\legacy\application\cli.php
on line 21

Anything else basic that I am missing? The files are the latest joomla
platform from github.

Thanks, Marius


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Elin Waring  
View profile  
 More options Jul 19 2012, 9:19 am
From: Elin Waring <elin.war...@gmail.com>
Date: Thu, 19 Jul 2012 06:19:12 -0700 (PDT)
Local: Thurs, Jul 19 2012 9:19 am
Subject: Re: [jplatform] Setup for running phpunit tests

The best instructions are in the manual.

http://developer.joomla.org/manual/appe-Joomla_Platform_Manual-Analys...

Elin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marius van Rijnsoever  
View profile  
 More options Jul 19 2012, 10:02 am
From: Marius van Rijnsoever <mariu...@gmail.com>
Date: Thu, 19 Jul 2012 22:02:13 +0800
Local: Thurs, Jul 19 2012 10:02 am
Subject: Re: [jplatform] Setup for running phpunit tests
Most of the tests run fine. But for some reason the JApplication
Helper Tests cause fatal errors, as the base classes are not included
automatically (see previous emails).

I'll do some more diggin :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sam Moffatt  
View profile  
 More options Jul 19 2012, 12:07 pm
From: Sam Moffatt <pasa...@gmail.com>
Date: Thu, 19 Jul 2012 09:07:27 -0700
Local: Thurs, Jul 19 2012 12:07 pm
Subject: Re: [jplatform] Setup for running phpunit tests
What version of PHPUnit are you running?

Cheers,

Sam Moffatt
http://pasamio.id.au

On Thu, Jul 19, 2012 at 7:02 AM, Marius van Rijnsoever


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chad Windnagle  
View profile  
 More options Jan 16, 8:40 pm
From: Chad Windnagle <drmmr...@gmail.com>
Date: Wed, 16 Jan 2013 17:40:36 -0800 (PST)
Local: Wed, Jan 16 2013 8:40 pm
Subject: Re: Setup for running phpunit tests

Did you find a solution to this? I'm having this problem right now. It's
phpunit version 3.7.13, is that the problem? If so I can try to downgrade,
but I'd be just as interested in finding a way to update the tests to work
with the latest version so that this doesn't have to be a concern.

-Chad


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »