testing php objects with php_rvm and rspec
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
autotest
spec
Gemfile
Gemfile.lock
MITLICENSE
README.markdown
autotest.options

README.markdown

Example of testing php objects with rspec via php_vm


require 'php_vm'


describe 'test class' do
  
  before(:each) do
    
    @class_code = '
	class HelloClass {
	    public function __construct($name) {
	      $this->name = $name;
	    }

	    public function getName() {
	    return $this->name;
	    }
	}
    '
    
  end
  
  it "test for class instance property" do
    PHPVM.exec(@class_code)
    HelloClass = PHPVM::get_class("HelloClass")
    
    HelloClass.new("pippa").getName.should == ("pippa")
  end
  
  
end