Yaffs site version 1.1
[yaffs-website] / vendor / gabordemooij / redbean / testing / RedUNIT / Pretest.php
1 <?php
2
3 /**
4  * Pretest
5  *
6  * These tests will run before the configuration takes place
7  * in the unit test suite (mostly error handling tests).
8  *
9  * @file    RedUNIT/Pretest.php
10  * @desc    Test scripts that run before configuration
11  * @author  Gabor de Mooij and the RedBeanPHP Community
12  * @license New BSD/GPLv2
13  *
14  * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
15  * This source file is subject to the New BSD/GPLv2 License that is bundled
16  * with this source code in the file license.txt.
17  */
18
19 testpack('Running pre-tests. (before config).');
20
21 try {
22         R::debug( TRUE );
23         fail();
24 } catch( Exception $e ) {
25         pass();
26 }
27
28 asrt( R::testConnection(), FALSE);
29
30 R::addDatabase( 'broken', 'mysql:host=nowhere', 'defunct', 'void' );
31 R::selectDatabase( 'broken' );
32 asrt( R::testConnection(), FALSE );