Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
sudo pear install --nodeps --force phpunit/DbUnit-1.0.3
sudo pear install --nodeps --force phpunit/File_Iterator-1.2.6
sudo pear install --nodeps --force phpunit/PHPUnit-3.5.15
sudo pear install --nodeps --force phpunit/PHPUnit_MockObject-1.0.9
sudo pear install --nodeps --force phpunit/PHPUnit_Selenium-1.0.3
sudo pear install --nodeps --force phpunit/PHP_CodeCoverage-1.0.5
sudo pear install --nodeps --force phpunit/PHP_Timer-1.0.0
sudo pear install --nodeps --force phpunit/PHP_TokenStream-1.0.1
sudo pear install --nodeps --force phpunit/Text_template-1.1.0
@generalredneck
generalredneck / gist:1774672
Created February 8, 2012 22:24
Undefined Offset caused by diff module
https://www.a.achappell.allplayers.com/g/boyscoutsofamerica/node/222718
$path_map ... (Array, 2 elements)
0 (String, 4 characters ) node
1 (String, 6 characters ) 222718
Krumo version 0.2a | http://krumo.sourceforge.net Called from /mnt/apci/main/www/includes/menu.inc, line 580
$link_map ... (Array, 6 elements)
0 (String, 4 characters ) node
1 (String, 6 characters ) 222718
2 (String, 9 characters ) revisions
3 (String, 4 characters ) view
@generalredneck
generalredneck / module_cron.sh
Created February 16, 2012 18:37
drush cron run
#!/bin/bash
drush eval "variable_set('$1_cron_last', 0);"
drush eval "$1_cron();"
drush eval "variable_set('$1_cron_last', time());"
@generalredneck
generalredneck / pearinfo.txt
Created March 1, 2012 21:37
pear on my local
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.9 stable
Console_Getopt 1.3.1 stable
Log 1.12.7 stable
Net_Socket 1.0.10 stable
Net_URL 1.0.15 stable
PEAR 1.9.4 stable
PHP_CodeSniffer 1.3.3 stable
@generalredneck
generalredneck / selenium_console.php
Created March 2, 2012 22:18
a file you include using php -a to control browsers interactively using selenium.
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase/Driver.php';
class SeleniumConsole {
public $driver;
public $testId;
function __construct($browser) {
$this->testId = md5(uniqid(rand(), TRUE));
$this->driver = $this->getDriver($browser);
}
(x||y) && (z||y)
x y z
0 0 0 0
1 0 0 0
0 1 0 1
1 1 0 1
0 0 1 0
1 0 1 1
0 1 1 1
1 1 1 1
@generalredneck
generalredneck / saucelabs.txt
Created March 13, 2012 14:31
pear on my sandbox
Installed packages, channel saucelabs.github.com/pear:
======================================================
Package Version State
PHPUnit 3.5.24 stable
PHPUnit_Selenium 1.1.7 stable
PHPUnit_Selenium_SauceOnDemand 1.3.9 stable
Installed packages, channel pear.phpunit.de:
============================================
@generalredneck
generalredneck / selenium
Created June 22, 2012 22:00
seleniem service
SELENIUM_DIR='/usr/lib/headless-selenium'
SELENIUM_PROFILE_DIR=$SELENIUM_DIR/profiles/firefox/selenium
SELENIUM_JAR=$SELENIUM_DIR/selenium-server-standalone-2.24.1.jar
SELENIUM_LOG_DIR='/var/log/selenium'
DISPLAY=:42
if [ "$XVFB_SCREEN_GEOMETY" = "" ]
then
XVFB_SCREEN_GEOMETRY=1024x768x24
fi
case "${1:-''}" in
@generalredneck
generalredneck / selenium.txt
Created July 17, 2012 15:52
Selenium Meetup Description sampl
Selenium: What is it good for? Absolutely Something!
Common symptoms of the need for automated testing are:
* Missed Deadlines
* Grumpy and overworked QA
* Large support Queues
Automated testing with Selenium is the first step to start relieving those symptoms and is relatively easy to get going with the most basic tests requiring just a quick run through the websites most used features with Selenium IDE.
Allan Chappell, Web Developer and Selenium Expert from AllPlayers.com will present an overview of several solutions using combinations of Selenium, PHPunit, and continuous integration software such as Hudson, to show that automated Selenium Testing can be achieved by any team, no matter how big or small.
@generalredneck
generalredneck / headless-selenium-debug
Created July 20, 2012 15:30
headless-selenium-debug
notice: /Stage[main]/Java::Package_debian/Package[java]/ensure: created
debug: /Stage[main]/Java::Package_debian/Package[java]: The container Class[Java::Package_debian] will propagate my refresh event
debug: Class[Java::Package_debian]: The container Stage[main] will propagate my refresh event
debug: Exec[10gen-apt-key](provider=posix): Executing check 'apt-key list | grep 10gen'
debug: Executing 'apt-key list | grep 10gen'
debug: Exec[mongodb_initiate_replicaset](provider=posix): Executing check 'mongo --eval 'printjson(rs.conf());' | grep 'a.achappell.allplayers.com''
debug: Executing 'mongo --eval 'printjson(rs.conf());' | grep 'a.achappell.allplayers.com''
debug: Service[mongodb](provider=debian): Executing 'sh -c LANG=C invoke-rc.d mongodb status | grep -q '^mongodb.*running''
debug: Service[headless-selenium](provider=debian): Executing '/etc/init.d/headless-selenium status'
debug: Service[headless-selenium](provider=debian): Executing '/etc/init.d/headless-selenium start'