Exemple #1
0
 public static function tearDownAfterClass()
 {
     $origConfigElement = self::$_origConfigElement;
     if (false !== $origConfigElement) {
         Mage::getConfig()->setNode(Aligent_CacheObserver_Model_Config::XML_PATH_CACHEOBSERVER, $origConfigElement, true);
     }
     parent::tearDownAfterClass();
 }
 /**
  * 1. Verify the 'ebayenterprise_ebayenterprise_catalog_gather_exportbatches_madeup_feed' event is triggered
  *      with a container instance, feed type config and cutoff date.
  * 2. Verify the Pim model's buildFeed method is called with the batch.
  */
 public function testRunExport()
 {
     $batches = array($this->_batch);
     $this->replaceByMock('model', 'ebayenterprise_catalog/pim_batch_container', $this->_container);
     $this->replaceByMock('model', 'ebayenterprise_catalog/pim', $this->_pimMock);
     $this->_container->expects($this->any())->method('getBatches')->will($this->returnValue($batches));
     // make sure pim::buildFeed gets called with a batch
     $this->_pimMock->expects($this->once())->method('buildFeed')->will($this->returnSelf());
     // run the test.
     $exporter = Mage::getModel('ebayenterprise_catalog/exporter');
     EcomDev_Utils_Reflection::setRestrictedPropertyValue($exporter, '_config', $this->_configRegistry);
     $exporter->runExport();
     // make sure our event was fired
     EcomDev_PHPUnit_Test_Case_Config::assertEventDispatched('ebayenterprise_product_export_madeup_feed');
 }
 public function setUp()
 {
     $this->address = new Mage_Customer_Model_Address();
     $this->address->setFirstname('Joachim');
     $this->address->setLastname('Schmidt');
     $this->address->setStreet('Bei der Schmiede 5');
     $this->address->setCity('Hamburg');
     $this->address->setPostcode(21109);
     $this->address->setCountryId('DE');
     $this->store = Mage::app()->getStore(0)->load(0);
     $this->store->resetConfig();
     $this->store->setConfig('scoring/buergel/services', Netresearch_Buergel_Model_System_Source_Service::CONCHECK);
     $this->config = Mage::getModel('buergel/config');
     return parent::setUp();
 }
 public function setUp()
 {
     parent::setup();
     $this->kwixoCreditModel = Mage::getModel('ops/payment_KwixoCredit');
     $this->store = Mage::app()->getStore(0)->load(0);
 }
 public function testIsConfigured()
 {
     EcomDev_PHPUnit_Test_Case_Config::assertEventObserverDefined('global', 'eb2c_order_creation_failure', 'ebayenterprise_paypal/observer', 'rollbackExpressPayment', 'ebayenterprise_paypal_express_rollback');
 }
 /**
  * Test that events are configured as expected.
  * (Set up a fixture and call this from your public test method.)
  *
  * @param string $area the area of event observer definition, possible values are global, frontend, adminhtml
  * @param string $eventName is the name of the event that should be observed
  * @param string $observerClassAlias observer class alias, for instance catalog/observer
  * @param string $observerMethod the method name that should be invoked for
  */
 protected function _testEventConfig($area, $eventName, $observerClassAlias, $observerMethod)
 {
     $config = Mage::getConfig();
     $observerClassName = $config->getGroupedClassName('model', $observerClassAlias);
     EcomDev_PHPUnit_Test_Case_Config::assertEventObserverDefined($area, $eventName, $observerClassAlias, $observerMethod);
     $this->assertTrue(method_exists($observerClassName, $observerMethod), "Expected method '{$observerClassName}::{$observerMethod}' is not defined.");
 }
 public function setUp()
 {
     parent::setup();
     $this->_model = Mage::getModel('ops/config');
 }
 public function setUp()
 {
     $this->store = Mage::app()->getStore(0)->load(0);
     $this->config = Mage::getModel('buergel/config');
     parent::setUp();
 }
 public function setUp()
 {
     parent::setUp();
 }
 public function setUp()
 {
     parent::setup();
     $this->kwixoApresReceptionModel = Mage::getModel('ops/payment_kwixoApresReception');
     $this->store = Mage::app()->getStore(0)->load(0);
 }