<?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"; 
   
 
 |