A way to do unit testing online? (i.e. Google)? - php

I'm trying to setup phpUnit via my host however, they are severely outdated and the documentation on how to use it is non-existent (hosts version). I'm wondering is there a way to do online unit testing, where the framework is hosted somewhere other than my server?
For example does Google have a solution where I can just include a file from Google's server?
UPDATE:
OK so apparently there is no cloud based way to run phpUnit. So my problem is installing it. My host has a PEAR installer (I'm not familiar with how PEAR really works yet). However, the version that they have is phpUnit2 which is apparently related to phpUnit (https://github.com/sebastianbergmann/phpunit/). But that is all I can really find.
According to the above link, the main way to install phpUnit is through PEAR :
http://www.phpunit.de/manual/current/en/installation.html
It requires that I change channels, however, it doesn't look like I have access to do that. Some are suggesting I can just copy the files up to my server and use them that way. Is that the best way for me to do this? Are there other settings I need to change (on my server) to make this work?
Any information is much appreciated.

If I'm understanding your question correctly, there's no need to use your host's version; the entire library is just a simple file. Go download it yourself from sourceforge, upload it to your server, and you should be off and running.

I doubt that you will find something like this because in order to unit test a system you need to have access to the code and a remote site isn't able to get that access (i.e. the ability to call functions built into your application).

Related

"Minified" version of xampp?

I'm looking for a way to share my php applications with a colleague without using a server. My colleague isn't really versed in xampp and localhost stuff, so ideally, he shouldn't have to install or configure anything.
I'm already using SQLite to make my application more portable, but I need to figure out how to handle the php side of things. Is there a way to create a "mini" xampp or localhost that the php files can run on? Ideally, my colleague should just need to start up one program, at which point the localhost address would point to my files. Is something like that possible with xampp?
You can use ngrok. ngrok build a url for your localhost project. which you can share to your colleague or anywhere across the globe.
You can start a web server using the php executable:
php -S localhost:8000
http://php.net/manual/en/features.commandline.webserver.php
You can use Devserver. It's portable. You just have to put the Devserver folder (with your files in Local Directory) on a USB key.
It should be said that there are very, very few times where what you're talking about should be necessary. If this is a truly "personal use" case, you could just put the scripts online and set up an htaccess password for your friend. If it's software you're trying to distribute, you could create cloud access for it.
Having said that, I do have a piece of software in the wild that matches this description. The reason it needs to run its own server and be accessible locally is because it (a) runs in retail stores, (b) serves and receives data with a corporate android app only on the local network in those stores and (c) must continue to run with local data if the internet connection goes down at any given store.
The only way to do this at the moment is ship a physical mini PC stick, preloaded with XAMPP, the database, and the whole set of PHP scripts and a nice index.php file at the local root, to each and every store. In my case, this required building an internal update mechanism to push software updates as necessary. But you could probably just have your friend download a zip file with updates and replace his www root folder with it.
If you can afford $100 for a cheap PC on a stick, this is probably your best answer. It's definitely the fastest. You could wade into trying to compile your PHP code, but there is no complete solution for that.
It is actual question for me to, so I made a little research and from what I have read the most perspective way is to use a vagrant. You still will need to do a lot of configurations, but mainly on your side. Your college can deploy fairly easy and pain fry.
I found this article describing a basic workflow very useful.
Update #2: If for some reason vagrant or any other type of virtualization is not an option for you consider looking to portable xampp launcher instead

Running post build actions with external jobs in Jenkins

I'd like to run phpunit on an external server, the feed those results into a Jenkins plugin like the Clover PHP Coverage Report action.
The code base has some library dependancies that the owner of the Jenkins server does not want deployed.
Well with some tweaking I guess it is possible to make use of the monitoring external plugin. You will have to figure something out to get the files on the jenkins server.
An other option is, if the server owner is willing, to create a specific build agent for your needs. That doesn't affect his jobs and you can use your builds like you want.
Yes, library dependencies shouldn't be installed globally on a Jenkins server, but this is where Composer comes into play: You'd essentially install exactly the dependencies your current software needs locally in the workspace of your job.
Nobody should be bothered by this, because you could also include the needed library code there manually - or even worse, you could use the same file and class names and code something entirely different. All of this must not interfere with any other job running on that same server, and it doesn't.
You can't really avoid Composer, because PHPUnit will stop being distributed via PEAR, as well as some Symfony components that are being used. Better go to the Composer project page and learn how to use it. By the way: You can include the needed version of PHPUnit with Composer as well, so you need not rely on a centrally installed version (which is hard to update because there are so many jobs that would need updates then - too much work in one go).

Versioning and development process setup for php + mysql with atlassian helpers

I have been researching a bit to try and configure a good development and release process for a 20+ strength development team with multi project responsibilities.
I wanted to go with GIT as the versioning system since it is easy to use, setup, backup and what not. I tried to read through several guides of svn and i realized well i dont have the time to setup a complicated process. I was able to find git client support on both linux and windows and thus was happy with that.
Now to enable multi project authentication and access i started using gitosis on top of git and was able to get the functionality i needed.
Now i am looking to setup pre-commit specifically server hooks, to make sure my developers follows phpcs thoroughly and i dont want them to checkin if they dont. Now is where GIT is giving me problems. Does there exist a server side pre-commit hook detection for GIT ? I looked around but people are using SVN when this need arose. Later maybe i would like to configure similar hooks for both jabascript and css since we are using them extensively, and i found something similar to phpcs going by the name of Squiz. I hope to use that.
Also i am looking for setting up hudson to integrate with JIRA and GIT to setup both builds and iterations for each project. Are there are pitfalls to look for here or this setup with not work ? If this works could i be pointed to some document where i can see how it will work for me?
No there are no pre-commit hooks that reside on the server, since you never commit remotely, you always commit locally. However, you could have hooks on the server that runs when people try to push code to it.
Spotify uses hudson, jira and git in their development process and it seems to be a successful combination. If you like code reviews you can also attach Gerrit.

WindowsAzure: Develop on deployed PHP Files

I work a lot with the WindowsAzure4E(clipse) IDE. And it's always pain to wait for the local test deployment)
Isn't there a way to develop on the deployed PHP files which must be stored somewhere to inetput or something else?
thx for your ideas.
Yes! In fact, I just got this working myself yesterday.
After installing PHP 5.3 with CGI support for IIS (making the necessary php.ini modifications of course), I simply created a new site in IIS that mapped to a role in the workspace for my Eclipse project.
Keep in mind that there's one hiccup to this and that is that the php_azure.dll file, used to access the service configuration and mount azure drives, was built to run in the azure fabric (either development or hosted). In my case, I don't NEED these features so I removed referrences to things like getconfig and poof the project loads in IIS just fine. I only need to make sure I start Azure Storage prior to launching the application.
I've been told that some folks are able to update their systems path environment variable with the location of the azure diagnostics dll (diagnostics.dll) and have it work without this modification. But this route didn't work for me. :(
I'll actually be blogging on this more this weekend as it took me a week of evenings to get things sorted out.
I found out that after the deployment the project files are copied to the folder ServiceDefinition.csx.
When you now edit the source code in this place, you can see the changes directly, without another deployment.

Setup SVN/LAMP/Test Server/ on linux, where to start?

I have a ubuntu machine I have setup. I installed apache2 and php5 on it. I can access the web server from other machines on the network via http://linux-server. I have subversion installed on it. I also have vsftpd installed on it so I can ftp to it from another computer on the network.
Myself and other users currently use dreamweaver to checkin-checkout files directly from our live site to make changes.
I want the connect to the linux server from pc. make the changes on the test server until ready and then pushed to the live site. I want to use subversion also into this workflow as well. but not sure what the best workflow is or how to set this up.
I have no experience with linux, svn, or even using a test server, the checkin/out we are currently doing is the way I have always done it.
I have hit many snags already just getting what I have setup because of my lack of knowledge in the area. Dreamweaver 5 has integration with subversion but I can't figure out how to get it to work.
I want to setup and create the best workflow possible.
I dont expect anyone to be able to give me an answer that will enlighten me enough to know everthing I need to know to do what I want to do (altough if possible that would be great) instead I am looking for maybe a knowledge path like answer. Like a general outline of what I need to do accompanied with links to learn how to do it. like read this book to learn linux, then read this article to learn svn, etc., then you should know what to do. I would be happy just getting it all setup, but I would like to know what I am actually doing while setting it up too.
I'm sure you've solved your issue by now, but for future reference to other users, here's the steps I would suggest to get started:
Create a repository for your project (in Ubuntu)
Host the SVN repo using Apache
I'd read up on the subversion book to look at some strategies for development with SVN.
To connect to your SVN machine, you'll need to use it's IP or hostname instead of your svn live site you mentioned. With proper forwarding, it's easy to access it from anywhere.

Categories