Untitled

 avatar
user_6475215
php
a year ago
1.5 kB
1
Indexable
Never
<?

...

public function GetMockServerPayload(){
    $path = fake()->filePath();
    return [
      'ip' => fake()->ipv6(),
      'port' => fake()->numberBetween(1000, 65535),
      'username' => fake()->userName(),
      'use_certificate' => true,
      'certificate_file' => fake()->file(),
      'certificate_private_key_file' => fake()->file($path),
      'certificate_hashing' => fake()->md5(),
      'bundle_directory' => fake()->filePath(),
      'bundle_prefix' => fake()->word(),
      'country' => fake()->country(),
      'production_directory' => fake()->filePath(),
      'settings' => [
        'prop1' => fake()->uuid(),
        'prop2' => fake()->uuid()
      ],
      'allow_new_users' => true,
      'active' => true
    ];
  }
...
?>

i crash on fake->file() or fake->file($path) try both failed

i get this unclear error

InvalidArgumentException: Source and target directories must differ.
/Users/sivan/projects/wolberg-pro/site-generator/vendor/fakerphp/faker/src/Faker/Provider/File.php:587
/Users/sivan/projects/wolberg-pro/site-generator/vendor/fakerphp/faker/src/Faker/Generator.php:696
/Users/sivan/projects/wolberg-pro/site-generator/vendor/fakerphp/faker/src/Faker/Generator.php:961
/Users/sivan/projects/wolberg-pro/site-generator/tests/Unit/Helpers/Admin/ServerHelper.php:157
/Users/sivan/projects/wolberg-pro/site-generator/tests/Unit/Admin/ServerDatabaseTest.php:872
/Users/sivan/projects/wolberg-pro/site-generator/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:174