PHP Classes

File: vendor/gabordemooij/redbean/testing/RedUNIT/Pretest.php

Recommend this page to a friend!
  Classes of Adrian M   upMVC   vendor/gabordemooij/redbean/testing/RedUNIT/Pretest.php   Download  
File: vendor/gabordemooij/redbean/testing/RedUNIT/Pretest.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: upMVC
Pure PHP web development without other frameworks
Author: By
Last change:
Date: 1 month ago
Size: 806 bytes
 

Contents

Class file image Download
<?php

/**
 * Pretest
 *
 * These tests will run before the configuration takes place
 * in the unit test suite (mostly error handling tests).
 *
 * @file RedUNIT/Pretest.php
 * @desc Test scripts that run before configuration
 * @author Gabor de Mooij and the RedBeanPHP Community
 * @license New BSD/GPLv2
 *
 * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
 * This source file is subject to the New BSD/GPLv2 License that is bundled
 * with this source code in the file license.txt.
 */

testpack('Running pre-tests. (before config).');

try {
   
R::debug( TRUE );
   
fail();
} catch(
Exception $e ) {
   
pass();
}

asrt( R::testConnection(), FALSE);

R::addDatabase( 'broken', 'mysql:host=nowhere', 'defunct', 'void' );
R::selectDatabase( 'broken' );
asrt( R::testConnection(), FALSE );