第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

使用 Codeception 進(jìn)行單元測(cè)試:解析錯(cuò)誤

使用 Codeception 進(jìn)行單元測(cè)試:解析錯(cuò)誤

PHP
翻閱古今 2023-07-21 16:20:52
我正在嘗試為我的簡(jiǎn)單網(wǎng)站編寫一些單元測(cè)試(用于研究)。項(xiàng)目結(jié)構(gòu):在index.php 里面我有一個(gè)namespace Main定義。函數(shù)位于namespace Main\Logic,類位于namespace Main\Logic\Classes。代碼tests/unit/BuildGalleryTest.php:<?phpnamespace Tests\Unit;use Codeception\Test\Unit as TestCase;use function Main\Logic\galleryBuilder;require "/Users/l.marder/Homeworks/php-study/lesson4/logic/galleryBuilder.php";class BuildGalleryTest extends TestCase{    /**     * @dataProvider buildGalleryDataProvider     * @param string $imgPack     * @param string $expectedResponse     */    public function testBuildGallery(string $imgPack, string $expectedResponse): void    {        $actualResponse = galleryBuilder("tests/unit/test_data/img/$imgPack");        self::assertEquals($expectedResponse, $actualResponse);    }    public function buildGalleryDataProvider(): array    {        return            [                "Data pack 1: one pic" => [                    "1",                    $this->buildTestGallery("1")                ],                "Data pack 2: two pics with folder and text.txt file" => [                    "2",                    $this->buildTestGallery("2")                ],                "Data pack 3: no images" => [                    "3",                    $this->buildTestGallery("3")                ]            ];    }    private function buildTestGallery(string $dataPack): string    {        if ($dataPack === "1") {            return "            <a href=\"picture.php?img=tests/unit/test_data/img/1/1.img\" target=\"_blank\">                <div class=\"small-pic\">                    <img class=\"img-small-kit\" src= alt=\"Kitty 2\">                </div>            </a>";        }我究竟做錯(cuò)了什么?可以采取什么措施來(lái)解決這個(gè)問題?
查看完整描述

1 回答

?
墨色風(fēng)雨

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊

我已經(jīng)使用 sphp 將 php 版本更改為 7.4,現(xiàn)在一切正常!



查看完整回答
反對(duì) 回復(fù) 2023-07-21
  • 1 回答
  • 0 關(guān)注
  • 115 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)