Skip to content

Instantly share code, notes, and snippets.

@cbiggins
Created March 6, 2013 00:40
Show Gist options
  • Select an option

  • Save cbiggins/5095759 to your computer and use it in GitHub Desktop.

Select an option

Save cbiggins/5095759 to your computer and use it in GitHub Desktop.

Revisions

  1. cbiggins created this gist Mar 6, 2013.
    57 changes: 57 additions & 0 deletions fma.test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    <?php
    /**
    * @file
    * Our simpletests for the FMA install profile.
    * @copyright Copyright(c) 2012 Previous Next Pty Ltd
    * @license GPL v2 http://www.fsf.org/licensing/licenses/gpl.html
    * @author Christian Biggins christian at previousnext dot com dot au
    */

    class FMATestCase extends DrupalWebTestCase {
    /** Make sure SimpleTest knows which profile to install **/
    protected $profile = 'FMA';
    protected $privileged_user;

    /**
    * Our test info.
    */
    public static function getInfo() {
    // Note: getInfo() strings are not translated with t().
    return array(
    'name' => 'FMA Install Profile',
    'description' => 'General tests for install profile.',
    'group' => 'FMA',
    );
    }

    /**
    * Our setup.
    */
    protected function setUp() {
    debug('setup start');
    parent::setUp(array('dblog', 'fma_taxonomy', 'fma_show'));
    debug('setup mid');
    // Create and log in our privileged user.
    $this->privileged_user = $this->drupalCreateUser(array('administer nodes', 'administer modules'));
    $this->drupalLogin($this->privileged_user);
    debug('setup end');
    }

    /**
    * Test our content type.
    */
    public function testShowPropeties() {

    $settings = array(
    'type' => 'fma_show',
    'title' => $this->randomName(32),
    'body' => array(LANGUAGE_NONE => array(array($this->randomName(64)))),
    );

    $node = $this->drupalCreateNode($settings);

    // Content type exists.
    $this->assertTrue(!empty($node), 'Test node created.');
    }

    }