Creating our first test

Mink tests are also stored in the Test folder; let's create the base skeleton of our Mink test class:

  1. Navigate to the Test folder in our module root.
  2. Create a new directory called Mink.
  3. Inside the Mink directory, create a new PHP class called Registry.php.
  4. Copy the following code at the Registry.php file, located at app/code/local/Mdg/Giftregistry/Test/Mink/Registry.php:
    <?php class Mdg_Giftregistry_Test_Mink_Registry extends JR_Mink_Test_Mink { public function testAddProductToRegistry() { $this->section('TEST ADD PRODUCT TO REGISTRY'); $this->setCurrentStore('default'); $this->setDriver('goutte'); $this->context(); // Go to homepage $this->output($this->bold('Go To the Homepage')); $url = Mage::getStoreConfig('web/unsecure/base_url'); ...

Get Magento PHP Developer's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.