Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created March 20, 2013 18:17
Show Gist options
  • Save msonnabaum/5207099 to your computer and use it in GitHub Desktop.
Save msonnabaum/5207099 to your computer and use it in GitHub Desktop.
#!/bin/sh
convert_test() {
FILE=$1
sed -i '' -e's/simpletest\\UnitTestBase/Tests\\UnitTestCase/' "$FILE"
sed -i '' -e's/UnitTestBase/UnitTestCase/' "$FILE"
sed -i '' -e's/assertIdentical/assertSame/' "$FILE"
sed -i '' -e's/assertNotIdentical/assertNotSame/' "$FILE"
sed -i '' -e's/assertEqual(/assertEquals(/' "$FILE"
sed -i '' -e's/assertNotEqual(/assertNotEquals(/' "$FILE"
sed -i '' -e's/namespace Drupal\\system\\Tests\\/namespace Drupal\\Tests\\/' "$FILE"
}
if [ -f $1 ]
then
convert_test $1
else
find tests -name "*.php" | while read FILE
do
convert_test $FILE
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment