Execute your CakePHP tests in your IDE

If you use an IDE that supports Ant, like PHPEclipse, you can simply add the following Ant script to your project:

<?xml version="1.0"?>
<project name="YOUR_PROJECT" default="test">
	
	<property name="scriptsDir" value="PATH_TO_SCRIPTS_DIR" />
	
	<target name="test">
		<exec dir="${scriptsDir}" executable="php">
			<arg line="test.php" />
		</exec>
	</target>
</project>

Update (2006-01-10): This script is no longer useful because scripts/test.php has been removed from CakePHP.

5 Comments

  1. Posted January 9, 2006 at 4:15 pm | Permalink

    How does PHPEclipse compare to Zend Studio? I’m on an ISDN line (64 kbit) so it’d be good to know if it’s worth trying it out.

  2. Posted January 9, 2006 at 4:54 pm | Permalink

    Hm, difficult to say as I don’t have any experience with Zend Studio. I simply use PHPEclipse because I’m used to Eclipse, and I can have both Java and PHP projects in the same IDE. Negative aspects of using PHPEclipse are the plug-in hell and that there is no syntax-highlighting/code-completion in thtml-Files. HTH.

  3. WP
    Posted August 1, 2006 at 8:49 am | Permalink

    You can add a file type to be syntax-highlighted.

    In Linux open up ~/.eclipse/org.eclipse.sdk.ide/updates/eclipse/plugins/net.sourceforge.phpeclipse_1.1.8/plugin.xml

    Search for all instances of php4 and add a new line like the entry.

  4. WP
    Posted August 1, 2006 at 8:59 am | Permalink

    —-
    Reposting because WordPress ate up my xml tags
    —-

    You can add a file type to be syntax-highlighted.

    In Linux open up ~/.eclipse/org.eclipse.sdk.ide/updates/eclipse/plugins/net.sourceforge.phpeclipse_1.1.8/plugin.xml

    Search for all instances of php4 and add in thtml where php4 exists.

  5. Posted August 1, 2006 at 10:19 am | Permalink

    WP: Well, in the meantime I found a solution: https://cakebaker.wordpress.com/2006/01/30/syntaxhighlighting-in-thtml-files-with-phpeclipse/

    But anyway, thanks for the tip :)


%d bloggers like this: