putObject($input, $bucket, $uri); $headers = $s3->headObject($bucket, $uri); static::assert(isset($headers['size']), 'The returned headers do not contain the object size'); static::assert($headers['size'] == AbstractTest::TEN_KB, 'The returned size does not match'); // Remove the local files @unlink($sourceFile); // Delete the remote file. Throws exception if it fails. $s3->deleteObject($bucket, $uri); return true; } public static function testMissingFile(Connector $s3, array $options): bool { $bucket = $options['bucket']; try { $headers = $s3->headObject($bucket, md5(microtime(false)) . '_does_not_exist'); } catch (CannotGetFile $e) { return true; } return false; } }