You are here

function Faq_AskTestCase::faqVerifyUrl in FAQ_Ask 7

Asserts the current url to the passed one

Parameters

string $url: The passed url to verify against

1 call to Faq_AskTestCase::faqVerifyUrl()
CRAUDFaq_AskTestCase::testFaq_AskCreate in ./faq_ask.test
Test creating an unanswered FAQ and verify its status Also switches on notifcation of asker and verifies that anonymous are sent an e-mail by cron run

File

./faq_ask.test, line 187
Test Faq_Ask functionality Base test class. All tests inherits this one Hugely based on code from the test file block.test by boombatower

Class

Faq_AskTestCase
Base class that is extended by test cases

Code

function faqVerifyUrl($url, $msg) {
  $current_url = parse_url($this
    ->getUrl());
  if (!isset($current_url['query']) || $current_url['query'] == '') {
    $query = substr($current_url['path'], 1);

    // Split off the "/" part
    $this
      ->assertEqual($query, $url, $msg);
  }
  else {
    $query = substr($current_url['query'], 2);

    // Split off the q= part
    $this
      ->assertEqual($query, $url, $msg);
  }
  $this
    ->pass('Current URL:<pre>' . print_r($current_url, TRUE) . '</pre>');
}