-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
49 lines (36 loc) · 1.55 KB
/
test.php
File metadata and controls
49 lines (36 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Faker\Factory;
use TeaRiot\FakerFillThis\Faker\Provider\FillThisImage;
$faker = Factory::create();
$faker->addProvider(new FillThisImage($faker));
echo "=== Main Page ===\n";
echo "Main page: " . FillThisImage::BASE_URL . "\n\n";
echo "1. Default image (no dimensions):\n";
echo $faker->imageUrl(0, 0) . "\n\n";
echo "2. Image with single dimension 500 (500x500):\n";
echo $faker->imageUrl(500, 500, null, false, null, false, "png") . "\n\n";
echo "3. Image with random word:\n";
echo $faker->imageUrl(800, 600, null, true, null, false, "png") . "\n\n";
echo "4. Placeholder for nonexistent category:\n";
echo $faker->imageUrl(0, 0, "nonexistent", false, null, false, "png") . "\n\n";
echo "5. Image from category \"fashion\":\n";
echo $faker->imageUrl(0, 0, "fashion", false, null, false, "png") . "\n\n";
echo "6. Image from category \"all\":\n";
echo $faker->imageUrl(0, 0, "all", false, null, false, "png") . "\n\n";
echo "7. Video URL:\n";
echo $faker->url('video') . "\n\n";
echo "8. Download image example:\n";
$imagePath = $faker->image(__DIR__, 800, 600, null, true, true, "TestImage", false, "png");
if ($imagePath !== false) {
echo "Image downloaded at: " . $imagePath . "\n";
} else {
echo "Error downloading image.\n";
}
echo "\n9. Download image from category \"fashion\":\n";
$imagePath = $faker->image(__DIR__, 0, 0, "fashion", true, true, null, false, "png");
if ($imagePath !== false) {
echo "Image downloaded at: " . $imagePath . "\n";
} else {
echo "Error downloading image.\n";
}