Skip to content

Instantly share code, notes, and snippets.

@GeniJaho
Created June 18, 2021 13:10
Variables to test against
<?php
$this->actingAs($user);
// Test image attributes ----------------------------
$exifImage = file_get_contents($this->imagePath);
$file = UploadedFile::fake()->createWithContent(
'image.jpg',
$exifImage
);
$latitude = 40.053030045789;
$longitude = -77.15449870066;
$geoHash = 'dr15u73vccgyzbs9w4uj';
$displayName = '10735, Carlisle Pike, Latimore Township,' .
' Adams County, Pennsylvania, 17324, USA';
$address = [
"house_number" => "10735",
"road" => "Carlisle Pike",
"city" => "Latimore Township",
"county" => "Adams County",
"state" => "Pennsylvania",
"postcode" => "17324",
"country" => "United States of America",
"country_code" => "us",
"suburb" => "unknown"
];
// Since these models are created on runtime
// and we haven't uploaded any images before
// their ids should be 1
$countryId = 1;
$stateId = 1;
$cityId = 1;
$dateTime = now();
$year = $dateTime->year;
$month = $dateTime->month < 10 ? "0$dateTime->month" : $dateTime->month;
$day = $dateTime->day < 10 ? "0$dateTime->day" : $dateTime->day;
$localUploadsPath = "/local-uploads/$year/$month/$day/{$file->hashName()}";
$filepath = public_path($localUploadsPath);
$imageName = config('app.url') . $localUploadsPath;
// Test image attributes ----------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment