Skip to content

Commit

Permalink
Use 5.3 as the default php version instead of 5.3.8, exact points ver…
Browse files Browse the repository at this point in the history
…sions change over time
  • Loading branch information
michaelklishin committed Feb 1, 2012
1 parent 7f9789a commit e0a2fb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/travis/build/job/test/php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Job
class Test
class Php < Test
class Config < Hashr
define :php => '5.3.8'
define :php => '5.3'
end

def setup
Expand Down
28 changes: 21 additions & 7 deletions spec/build/job/test/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,32 @@
let(:job) { Travis::Build::Job::Test::Php.new(shell, nil , config) }

describe 'config' do
it 'defaults :php to "5.3.8"' do
config.php.should == '5.3.8'
it 'defaults :php to "5.3"' do
config.php.should == '5.3'
end
end

describe 'setup' do
it 'switches to the given php version' do
shell.expects(:export_line).with("TRAVIS_PHP_VERSION=5.3.8").returns(true)
shell.expects(:execute).with('phpenv global 5.3.8').returns(true)
shell.expects(:execute).with('php --version')
context "when PHP version is not explicitly specified and we have to use the default one" do
it 'switches to the default php version' do
shell.expects(:export_line).with("TRAVIS_PHP_VERSION=5.3").returns(true)
shell.expects(:execute).with('phpenv global 5.3').returns(true)
shell.expects(:execute).with('php --version')

job.setup
end
end

context "when PHP version IS explicitly specified" do
let(:config) { Travis::Build::Job::Test::Php::Config.new(:composer_args => '--dev', :php => "5.4") }

it 'switches to the given php version' do
shell.expects(:export_line).with("TRAVIS_PHP_VERSION=5.4").returns(true)
shell.expects(:execute).with('phpenv global 5.4').returns(true)
shell.expects(:execute).with('php --version')

job.setup
job.setup
end
end
end

Expand Down

0 comments on commit e0a2fb2

Please sign in to comment.