當前位置: 首頁>>代碼示例>>PHP>>正文


PHP teardown函數代碼示例

本文整理匯總了PHP中teardown函數的典型用法代碼示例。如果您正苦於以下問題:PHP teardown函數的具體用法?PHP teardown怎麽用?PHP teardown使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了teardown函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_WIPE_FILE);
 }
開發者ID:nurulimamnotes,項目名稱:flourish-old,代碼行數:7,代碼來源:fSQLTranslationTest.php

示例2: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     self::$db->execute(fix_schema(file_get_contents(DB_ALTERNATE_SCHEMA_WIPE_FILE)));
     teardown(self::$db, DB_WIPE_FILE);
 }
開發者ID:nurulimamnotes,項目名稱:flourish-old,代碼行數:8,代碼來源:fSchemaWithMultipleSchemasTest.php

示例3: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_EXTENDED_TEARDOWN_FILE);
     teardown(self::$db, DB_TEARDOWN_FILE);
 }
開發者ID:netcarver,項目名稱:flourish,代碼行數:8,代碼來源:fORMValidationTest.php

示例4: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     if (defined('SKIPPING')) {
         return;
     }
     teardown(self::$db, DB_TEARDOWN_FILE);
     self::$db->__destruct();
 }
開發者ID:netcarver,項目名稱:flourish,代碼行數:8,代碼來源:fDatabaseTest.php

示例5: assert_equals

     assert_equals(true, transient()->setup1);
 });
 // TODO this is terrible
 should("count the number of tests", function () {
     assert_equals(4, Smoothie::instance()->tests);
 });
 // TODO this is terrible
 should("count the number of assertions", function () {
     assert_equals(4, Smoothie::instance()->assertions);
 });
 context("nested in a context", function () {
     setup(function () {
         transient()->setup2 = true;
     });
     teardown(function () {
         $GLOBALS['I_RAN_TEARDOWN'] = true;
     });
     should("have called its parent setup", function () {
         assert_equals(true, transient()->setup1);
     });
     should("have called its own setup", function () {
         assert_equals(true, transient()->setup2);
     });
     context("nested in a context", function () {
         setup(function () {
             transient()->setup3 = true;
         });
         should("have called all three setups", function () {
             assert_equals(true, transient()->setup1);
             assert_equals(true, transient()->setup2);
             assert_equals(true, transient()->setup3);
開發者ID:kla,項目名稱:smoothie,代碼行數:31,代碼來源:ContextTest.php

示例6: write_xml

/**
 * Write XML data to a file.
 * @param string $contents
 * @param string $xml_path where we write this
 */
function write_xml($contents, $xml_path)
{
    if ($fh = @fopen($xml_path, 'w')) {
        fwrite($fh, $contents);
        fclose($fh);
        print 'config.xml file written at ' . $xml_path . PHP_EOL;
    } else {
        print 'There was a problem opening ' . $xml_path . ' for writing.' . PHP_EOL;
        print 'You can paste the following contents into ' . $xml_path . PHP_EOL;
        print 'and then run:  php ./index.php --installmode=new' . PHP_EOL;
        print 'or navigate to your site via a browser and do a normal installation.' . PHP_EOL . PHP_EOL;
        print $contents;
        print PHP_EOL . PHP_EOL;
        teardown();
    }
}
開發者ID:Vitaliz,項目名稱:modx_utils,代碼行數:21,代碼來源:installmodx.php

示例7: suite

<?php

/*
 * How to use teardown
 */
namespace Preview\DSL\TDD;

require_once __DIR__ . '/../ok.php';
suite("teardown", function () {
    teardown(function () {
        $this->usage = "run teardown each test case";
    });
    teardown(function () {
        $this->note = "teardown hooks are run in order";
    });
});
開發者ID:v2e4lisp,項目名稱:preview,代碼行數:16,代碼來源:teardown_spec.php


注:本文中的teardown函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。