mirror of https://github.com/MISP/MISP
107 lines
3.8 KiB
PHP
107 lines
3.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Test\Fixture;
|
|
|
|
use Cake\TestSuite\Fixture\TestFixture;
|
|
|
|
class ServersFixture extends TestFixture
|
|
{
|
|
public $connection = 'test';
|
|
|
|
public const SERVER_A_ID = 1000;
|
|
public const SERVER_A_NAME = 'Server A';
|
|
public const SERVER_A_URL = 'http://aaa.local';
|
|
public const SERVER_A_AUTHKEY = '8843d7f92416211de9ebb963ff4ce28125932878';
|
|
|
|
public const SERVER_B_ID = 2000;
|
|
public const SERVER_B_NAME = 'Server B';
|
|
public const SERVER_B_URL = 'http://bbb.local';
|
|
|
|
public const SERVER_C_ID = 3000;
|
|
public const SERVER_C_NAME = 'Server C';
|
|
public const SERVER_C_URL = 'http://ccc.local';
|
|
|
|
public function init(): void
|
|
{
|
|
$faker = \Faker\Factory::create();
|
|
|
|
$this->records = [
|
|
[
|
|
'id' => self::SERVER_A_ID,
|
|
'org_id' => OrganisationsFixture::ORGANISATION_A_ID,
|
|
'name' => self::SERVER_A_NAME,
|
|
'url' => self::SERVER_A_URL,
|
|
'authkey' => self::SERVER_A_AUTHKEY,
|
|
'push' => true,
|
|
'pull' => true,
|
|
'push_sightings' => true,
|
|
'push_galaxy_clusters' => true,
|
|
'pull_galaxy_clusters' => true,
|
|
'organization' => 'Org A',
|
|
'remote_org_id' => $faker->numberBetween(1000, 2000),
|
|
'publish_without_email' => true,
|
|
'unpublish_event' => true,
|
|
'self_signed' => true,
|
|
'pull_rules' => json_encode([]),
|
|
'push_rules' => json_encode([]),
|
|
'internal' => false,
|
|
'skip_proxy' => false,
|
|
'remove_missing_tags' => false,
|
|
'caching_enabled' => false,
|
|
'priority' => 1,
|
|
],
|
|
[
|
|
'id' => self::SERVER_B_ID,
|
|
'org_id' => OrganisationsFixture::ORGANISATION_B_ID,
|
|
'name' => self::SERVER_B_NAME,
|
|
'url' => self::SERVER_B_URL,
|
|
'authkey' => $faker->sha1(),
|
|
'push' => true,
|
|
'pull' => true,
|
|
'push_sightings' => true,
|
|
'push_galaxy_clusters' => true,
|
|
'pull_galaxy_clusters' => true,
|
|
'organization' => 'Org B',
|
|
'remote_org_id' => $faker->numberBetween(1000, 2000),
|
|
'publish_without_email' => true,
|
|
'unpublish_event' => true,
|
|
'self_signed' => true,
|
|
'pull_rules' => json_encode([]),
|
|
'push_rules' => json_encode([]),
|
|
'internal' => false,
|
|
'skip_proxy' => false,
|
|
'remove_missing_tags' => false,
|
|
'caching_enabled' => false,
|
|
'priority' => 1,
|
|
],
|
|
[
|
|
'id' => self::SERVER_C_ID,
|
|
'org_id' => OrganisationsFixture::ORGANISATION_C_ID,
|
|
'name' => self::SERVER_C_NAME,
|
|
'url' => self::SERVER_C_URL,
|
|
'authkey' => $faker->sha1(),
|
|
'push' => true,
|
|
'pull' => true,
|
|
'push_sightings' => true,
|
|
'push_galaxy_clusters' => true,
|
|
'pull_galaxy_clusters' => true,
|
|
'organization' => 'Org B',
|
|
'remote_org_id' => $faker->numberBetween(1000, 2000),
|
|
'publish_without_email' => true,
|
|
'unpublish_event' => true,
|
|
'self_signed' => true,
|
|
'pull_rules' => json_encode([]),
|
|
'push_rules' => json_encode([]),
|
|
'internal' => false,
|
|
'skip_proxy' => false,
|
|
'remove_missing_tags' => false,
|
|
'caching_enabled' => false,
|
|
'priority' => 1,
|
|
],
|
|
];
|
|
parent::init();
|
|
}
|
|
}
|