ultimix
unit_tests.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
26  class unit_tests{
27 
38  function set_up()
39  {
40  }
41 
52  function tear_down()
53  {
54  }
55 
66  function test_load_package()
67  {
68  get_package( 'page::page_access' , 'last' , __FILE__ );
69 
70  return( 'TEST PASSED' );
71  }
72 
83  function test_gen_pages()
84  {
85  $PageAccess = get_package( 'page::page_access' , 'last' , __FILE__ );
86 
87  $Pages = $PageAccess->get_list_of_pages();
88 
89  foreach( $Pages as $i => $Page )
90  {
91  $PageContent = file_get_contents( HTTP_HOST.'/'.get_field( $Page , 'alias' ).'.html' );
92 
93  if( stripos( $PageContent , ' error:' ) !== false || stripos( $PageContent , 'Notice:' ) !== false ||
94  stripos( $PageContent , 'Warning:' ) !== false || stripos( $PageContent , 'exception' ) !== false )
95  {
96  return( 'ERROR: Error page is '.get_field( $Page , 'alias' ) );
97  }
98  }
99 
100  return( 'TEST PASSED' );
101  }
102  }
103 
104 ?>