You are here

function ShurlyTestCase::assertUrlShrinked in ShURLy 7

Assert whether a short URL exists for a given long URL.

Parameters

$long_url Long URL.:

1 call to ShurlyTestCase::assertUrlShrinked()
ShurlyTestCase::testSubmitSameUrlTwice in ./shurly.test
Test that we can submit the same long URL twice in a row and then submit another URL.

File

./shurly.test, line 90
Tests for the Shurly module.

Class

ShurlyTestCase
Shurly tests.

Code

function assertUrlShrinked($long_url) {
  $count = db_select('shurly', 's')
    ->fields('s')
    ->condition('destination', $long_url)
    ->countQuery()
    ->execute()
    ->fetchField();
  $message = t('URL @url has been shrinked', array(
    '@url' => $long_url,
  ));
  $this
    ->assertTrue($count > 0, $message);
}