Skip to content

Commit

Permalink
[OHAI-358] add test for php version parse
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored and btm committed Nov 25, 2013
1 parent 0221aed commit fe5489b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/unit/plugins/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@
@plugin.languages.should_not have_key(:php)
end

it "should parse builddate even if it's suhosin patched" do
@status = 1
@stdout = "PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30) \nCopyright (c) 1997-2013 The PHP Group\nZend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies"
@stderr = ""
@plugin.stub(:run_command).with({:no_status_check=>true, :command=>"php -v"}).and_return([@status, @stdout, @stderr])
@plugin.run
@plugin.languages[:php][:builddate].should eql("Aug 30 2013 04:30:30")
end

#########

test_plugin([ "languages", "php" ], [ "php" ]) do | p |
Expand Down

0 comments on commit fe5489b

Please sign in to comment.