PHP Classes

File: test/test.php

Recommend this page to a friend!
  Classes of Richard Keizer   Swype for PHP   test/test.php   Download  
File: test/test.php
Role: Unit test script
Content type: text/plain
Description: Unit test script
Class: Swype for PHP
Auto-complete words entered with a Swype keyboard
Author: By
Last change:
Date: 12 years ago
Size: 767 bytes
 

Contents

Class file image Download
<?php
 
  error_reporting
(E_ALL);
 
ini_set('display_errors', 1);
 
 
 
assert_options(ASSERT_ACTIVE, 1);
 
assert_options(ASSERT_WARNING, 0);
 
assert_options(ASSERT_QUIET_EVAL, 1);
 
  function
assertHandler($file, $line, $code) {
    echo
"The following test failed: {$code}\n";
  }
 
 
assert_options(ASSERT_CALLBACK, 'assertHandler');
 
 
/*
   * Start the tests
   */
 
 
$failures = 0;
 
 
$failures += !assert('file_exists("swypedecoder.class.php");');
 
$failures += !assert('file_exists("dictionary/en.words");');
 
  include_once
'swypedecoder.class.php';
 
 
$swype = new SwypeDecoder('en');
 
$failures += !assert('in_array("welcome", $swype->unSwype("werftghjklkjhgvcvbhjkiokmmnhgfre"));');

  echo
"There were {$failures} failed tests\n";