Skip to content

Commit

Permalink
Add fake sendmail script, adjust travis config to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Feb 2, 2013
1 parent edbefba commit 07f7a1b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ before_script:
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
- cd test
- cp testbootstrap-dist.php testbootstrap.php
- mkdir -p /var/qmail/bin
- cp fakemail.sh /var/qmail/bin/sendmail
- cp fakemail.sh /usr/sbin/sendmail
script:
- phpunit phpmailerTest
21 changes: 21 additions & 0 deletions test/fakesendmail.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#Fake sendmail script, adapted from:
#https://github.com/mrded/MNPP/blob/ee64fb2a88efc70ba523b78e9ce61f9f1ed3b4a9/init/fake-sendmail.sh
numPath="/tmp/fakemail"

mkdir -p $numPath

if [ ! -f $numPath/num ]; then
echo "0" > $numPath/num
fi
num=`cat $numPath/num`
num=$(($num + 1))
echo $num > $numPath/num

name="$numPath/letter_$num.txt"
while read line
do
echo $line >> $name
done
chmod 777 $name
/usr/bin/true

0 comments on commit 07f7a1b

Please sign in to comment.