-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Look for my environment:
Suppose that I have this model: Company/ModuleName/Model/Gateway:
class Company_ModuleName_Model_Gateway {
public function getBaseUrl() {
if (Mage::getStoreConfig("payment_services/payment/environment") == 'homolog'){
$url = 'http://homolog.example.com/sendRequest.aspx';
} else {
$url = 'http://example.com/sendRequest.aspx';
}
return $url;
}
}And this spec Company_ModuleName_Model_GatewaySpec:
class Company_ModuleName_Model_GatewaySpec {
function it_should_be_return_the_base_url()
{
$this->getBaseUrl()->shouldBeLike('http://homolog.example.com/sendRequest.aspx');
}
}But when run $ bin/phpspec run, I receive this error:
PHP Fatal error: Class 'Mage' not found in /home/joridos/Documents/projects/magento/magento-test/.modman/magento-clearsale/app/code/community/Cammino/Clearsale/Model/Gateway.php on line 151
This is because this call: Mage::getStoreConfig("payment_services/payment/environment").
How I solve this?
Reactions are currently unavailable