<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] ## 概述 PHPUnit支持對測試方法之間的顯式依賴關系進行聲明,通過添加`@depends`標記 >[info] 默認情況下,生產者所產生的返回值將“原樣”傳遞給相應的消費者。這意味著,如果生產者返回的是一個對象,那么傳遞給消費者的將是一個指向此對象的引用。如果需要傳遞對象的副本而非引用,則應當用 @depends clone 替代 @depends。 ## 實例 ### 單個依賴 <details> <summary>test.php</summary> ``` use PHPUnit\Framework\TestCase; class EmailTest extends TestCase{ public function testEmpty(): array{ $stack = []; $this->assertEmpty($stack); return $stack; } /** * 接受 testEmpry return 的值 * @depends testEmpty * @param array $stack * @return array */ public function testPush(array $stack): array{ $stack[] = 'foo'; $this->assertEquals('foo', $stack[0]); $this->assertNotEmpty($stack); return $stack; } /** * 接受 testPush 返回的值 * @depends testPush * @param array $stack */ public function testPop(array $stack):void { $this->assertEquals('foo', array_pop($stack)); $this->assertEmpty($stack); } } ``` </details> <br/> ### 同時依賴多個 <details> <summary>test.php</summary> ``` <?php use PHPUnit\Framework\TestCase; class MultipleDependenciesTest extends TestCase{ /** * @return int */ public function testOne(){ // 不加斷言會報錯 $this->assertTrue(true); return 1; } /** * @return int */ public function testTwo(){ $this->assertTrue(true); return 2; } /** * * @depends testOne * @depends testTwo */ public function testResult(){ $arr = func_get_args(); $this->assertEquals([1,2], $arr); } } ``` </details> <br/>
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看