My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members

NAME

MT::App::Test - Movable Type's utility for test


SYNOPSIS

  use MT::App::Test;

  use File::Basename qw( dirname );
  use File::Spec;

  # createing test app object
  $app = MT::App::Test->test_instance_of(
    data_dirs => dirname(File::Spec->rel2abs(__FILE__)),
  );
  $app->isa('MT::App::CMS'); # => true


  # model class for testing
  my $entry_class = $app->test_model('entry');

  # fetching entry that has not stored.
  my $entry_to_save = $entry_class->test_load_volatiles('to_save');
  $entry_to_save->save();


  # loading a "context" for test
  $app->test_template_load_context('ctx_1'),

  # building tag
  $entry_title = $app->test_template_build(\'<mt:EntryTitle>');

  # building tag by php
  $entry_title = $app->test_php_template_build(\'<mt:EntryTitle>');


  # building page
  $html = $app->test_build_page('dashboard.tmpl'),


  # requesting
  $html = $app->test_request('req_1'));
  
  

For more details.

Powered by Google Project Hosting