public function testReadmeExample() { /** * Add DummyImage provider to faker generator */ $faker = new Faker\Generator(); $faker->addProvider(new DummyImage($faker)); /** * Get url to PNG picture with black background color and white text `some text here` */ $imageUrl = $faker->someImageUrl(320, 240, [DummyImage::OPTION_BG_COLOR => '000000', DummyImage::OPTION_FG_COLOR => 'ffffff', DummyImage::OPTION_TEXT => 'some text here', DummyImage::OPTION_EXTENSION => DummyImage::EXTENSION_PNG]); /** * Download PNG picture with black background color and white text `some text here`. * Save picture to system temp folder and return filename only. */ $fileName = $faker->someImage(320, 240, [DummyImage::OPTION_BG_COLOR => '000000', DummyImage::OPTION_FG_COLOR => 'ffffff', DummyImage::OPTION_TEXT => 'some text here', DummyImage::OPTION_EXTENSION => DummyImage::EXTENSION_PNG, DummyImage::OPTION_DIR => sys_get_temp_dir(), DummyImage::OPTION_FULL_PATH => false]); unlink(sys_get_temp_dir() . DIRECTORY_SEPARATOR . $fileName); }