Subversion Repositories Applications.annuaire

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
536 mathias 1
 
2
#!/usr/bin/env bash
3
gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
4
if [ $? -ne 0 ]; then
5
    echo -e "\033[33mDownloading PGP Public Key...\033[0m"
6
    gpg --recv-keys D8406D0D82947747293778314AA394086372C20A
7
    # Sebastian Bergmann <sb@sebastian-bergmann.de>
8
    gpg --fingerprint D8406D0D82947747293778314AA394086372C20A
9
    if [ $? -ne 0 ]; then
10
        echo -e "\033[31mCould not download PGP public key for verification\033[0m"
11
        exit
12
    fi
13
fi
14
 
15
# Let's grab the latest release and its signature
16
if [ ! -f phpunit.phar ]; then
17
    wget https://phar.phpunit.de/phpunit.phar
18
fi
19
if [ ! -f phpunit.phar.asc ]; then
20
    wget https://phar.phpunit.de/phpunit.phar.asc
21
fi
22
 
23
# Verify before running
24
gpg --verify phpunit.phar.asc phpunit.phar
25
if [ $? -eq 0 ]; then
26
    echo
27
    echo -e "\033[33mBegin Unit Testing\033[0m"
28
    # Run the testing suite
29
    php --version
30
    php phpunit.phar --configuration phpunit.xml.dist
31
else
32
    echo
33
    chmod -x phpunit.phar
34
    mv phpunit.phar /tmp/bad-phpunit.phar
35
    mv phpunit.phar.asc /tmp/bad-phpunit.phar.asc
36
    echo -e "\033[31mSignature did not match! PHPUnit has been moved to /tmp/bad-phpunit.phar\033[0m"
37
    exit 1
38
fi