PHPUnit + Eclipse Configuration [message #555068] |
Wed, 25 August 2010 07:39  |
Eclipse User |
|
|
|
Hey!
I am using Eclipse to develop / modify files on a webserver in the local intranet (Webserver is Windows, my OS is Windows too). The Webserver is called tcweb (\\tcweb) and the htdocs folder is mapped to a network drive (W:\)
This all works perfectly fine, but now I want to start testing my files, but since I am not developing on my local machine, I came across some problems while testing / configuration.
First of all, I didn't figure out how to configure PHPUnit as External Tool because of all this different machines and pathes... I installed PHP Unit (with Pear and without) on my local machine, on the webserver, in my files directory, ... anyway I never got it to run 
So i found out about this PTI plug in and I installed PHP Unit this way: http://www.phphatesme.com/blog/tools/phpunit-mittels-pti-in- eclipse-einbinden/
With this way, simple tests works out, but if I am trying to include something (e.g. some classes,...) it always points the working directory to an eclipse subfolder (eclipse/plugins/...) and so all tests fail because the dependencies between the files do not work (if i use eclipse on the server) or I even can't include the file (because it is on the server and eclipse is on my local machine) altough the test folder with the test files i am executing is in the same file structure.
Is there any way to configure PHP Unit (maybe as an external tool?) so that I can test files on the webserver?
Thanks in Advance
|
|
|
|
|
Re: PHPUnit + Eclipse Configuration [message #555392 is a reply to message #555079] |
Thu, 26 August 2010 09:28  |
Eclipse User |
|
|
|
On 2010-08-25 13:58, h_lwcf@gmx.net wrote:
> Hey!
> Thanks for the fast reply!
> I am not sure how to do this exactly, can you post some configuration options /
> steps?
I don't know if SSH is suitable for Your configuration. I know that there are
some ports for windows but I don't know if there are any issues with this on
such platform. Maybe there is other type of remote access connection. Basically
All You need is just to execute command and take output from it so You can do
that using any protocol (including http etc.).
I'm using for this purpose SSH, basically because I wanted to have everything as
it can be done manually. If You are using console to perform test on webserver I
think it's what You are looking for.
If You will decide to use SSH I assume You have working SSH server and client on
You computer. Client have to be plain text (not graphic like putty) so You can
catch its output. I'm using for this purpose Cygwin.
Then You need to setup connection between client and server that will work
without any interaction, usually SSH require password but You can authorize with
public/private key. Google for this and You will find tons of tutorials. The
trick is that You need to setup this without *any* password. Usually You need to
use key agent and type there password for generated certificate and it will be
hard to merge sessions (password is valid only for session and You will start
new one each time) so it's not what we expect - still there is a need for
password. The trick is that You can generate certificate without password and
that one will not require whole key agent.
When You will have working ssh connection You can execute in command prompt:
> ssh user@server command
-> this should execute the command on server. So You are almost ready. Now You
can create script like You want and just invoke it as external tool. That's all.
The last note is that command is not executed in regular environment so
sometimes You will need to execute "source /etc/profile; command" to have right
encoding and system variables. It's good practice just to create test script and
keep all commands there.
The only issue I have using such path is that eclipse understands only "exit
code" and not any other code for colors. You need to turn off all ansi color
codes (this is easily done) or strip output using following command:
sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g"
-> this will give just plain text. Maybe I'm missing something and I hope some
day I eclipse will support ansi codes in console.
dmc
|
|
|
Powered by
FUDForum. Page generated in 0.04603 seconds