サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
買ってよかったもの
qiita.com
<?php namespace Test use PHPUnit\Framework\TestCase; use Sample; use ReflectionClass; class SampleTest extends TestCase { /** * privateメソッドのテスト */ public function testPrivateMethod(): void { $sample = new Sample(); $reflection = new ReflectionClass($sample); $method = $reflection->getMethod('メソッド名'); // アクセス許可 $method->setAccessible(true); // メソッド実行 $result = $method->invoke($sample, '引数'); // 検証
Help us understand the problem. What is going on with this article?
このページを最初にブックマークしてみませんか?
『qiita.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く