Reenable Twitter/Media Post tests

This commit is contained in:
Philipp 2021-12-09 22:08:31 +01:00
parent f84c696925
commit 204b8b6e49
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
5 changed files with 135 additions and 117 deletions

View file

@ -126,6 +126,25 @@ abstract class ApiTest extends FixtureTest
// We could probably do more checks here.
}
/**
* Get the path to a temporary empty PNG image.
*
* @return string Path
*/
protected function getTempImage()
{
$tmpFile = tempnam(sys_get_temp_dir(), 'tmp_file');
file_put_contents(
$tmpFile,
base64_decode(
// Empty 1x1 px PNG image
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=='
)
);
return $tmpFile;
}
/**
* Transforms a response into a JSON class
*