Привет, ребята, я пытаюсь создать тест phpunit для функции ниже.
/**
* Get file size
*
* @param string $filePath
* @return int
*/
public function getFileSize(string $filePath): int
{
if (!file_exists($filePath)) {
return 0;
}
return filesize($filePath);
}
Пока я пробовал вот так
/**
* Test get file size with invalid data
*/
public function testGetFileSizeWithValidData()
{
$filePath = 'rgreherher';
$service = new Tickets_Service_ContactMomentVehicle();
$result = $service->getFileSize($filePath);
$this->assertSame($result, $filePath);
}
Так что, когда я бегу в своем терминале, яя получаю ошибку как
<string:rgreherher> does not match expected type "integer".
Может кто-нибудь помочь мне, какую ошибку я сделал.
Заранее спасибо.