phpcs phpcbf
This commit is contained in:
@@ -8,36 +8,36 @@ use Cake\TestSuite\Fixture\TestFixture;
|
||||
/**
|
||||
* AddressesFixture
|
||||
*/
|
||||
class AddressesFixture extends TestFixture
|
||||
{
|
||||
/**
|
||||
class AddressesFixture extends TestFixture {
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'address_name' => 'Apple Headquarters',
|
||||
'contact_name' => 'Steve Jobs',
|
||||
'address_line1' => '1 Apple Park Way',
|
||||
'address_line2' => null,
|
||||
'city' => 'San Francisco',
|
||||
'city_id' => 125809,
|
||||
'state' => 'California',
|
||||
'state_id' => 1416,
|
||||
'postal_code' => '95014',
|
||||
'country' => 'United States',
|
||||
'country_id' => 233,
|
||||
'phone_number' => 'Lorem ipsum dolor sit a',
|
||||
'email' => 'test@test.com',
|
||||
'notes' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
|
||||
'foreign_key' => null,
|
||||
'model' => null,
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
public function init(): void {
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'address_name' => 'Apple Headquarters',
|
||||
'contact_name' => 'Steve Jobs',
|
||||
'address_line1' => '1 Apple Park Way',
|
||||
'address_line2' => null,
|
||||
'city' => 'San Francisco',
|
||||
'city_id' => 125809,
|
||||
'state' => 'California',
|
||||
'state_id' => 1416,
|
||||
'postal_code' => '95014',
|
||||
'country' => 'United States',
|
||||
'country_id' => 233,
|
||||
'phone_number' => 'Lorem ipsum dolor sit a',
|
||||
'email' => 'test@test.com',
|
||||
'notes' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
|
||||
'foreign_key' => null,
|
||||
'model' => null,
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,335 +10,335 @@ use ReflectionClass;
|
||||
/**
|
||||
* CountriesFixture
|
||||
*/
|
||||
class CountriesFixture extends TestFixture
|
||||
{
|
||||
/**
|
||||
class CountriesFixture extends TestFixture {
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 25,
|
||||
'name' => 'Bermuda',
|
||||
'iso3' => 'BMU',
|
||||
'numeric_code' => '060',
|
||||
'iso2' => 'BM',
|
||||
'phonecode' => '+1-441',
|
||||
'capital' => 'Hamilton',
|
||||
'currency' => 'BMD',
|
||||
'currency_name' => 'Bermudian dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.bm',
|
||||
'native' => 'Bermuda',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Bermudian, Bermudan',
|
||||
'timezones' => '[{"zoneName":"Atlantic/Bermuda","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"}]',
|
||||
'translations' => '{"kr":"버뮤다","pt-BR":"Bermudas","pt":"Bermudas","nl":"Bermuda","hr":"Bermudi","fa":"برمودا","de":"Bermuda","es":"Bermudas","fr":"Bermudes","ja":"バミューダ","it":"Bermuda","cn":"百慕大","tr":"Bermuda"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '32';
|
||||
$this->fractionalPart = '33333333';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '64';
|
||||
$this->fractionalPart = '75000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇧🇲',
|
||||
'emojiU' => 'U+1F1E7 U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 39,
|
||||
'name' => 'Canada',
|
||||
'iso3' => 'CAN',
|
||||
'numeric_code' => '124',
|
||||
'iso2' => 'CA',
|
||||
'phonecode' => '1',
|
||||
'capital' => 'Ottawa',
|
||||
'currency' => 'CAD',
|
||||
'currency_name' => 'Canadian dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.ca',
|
||||
'native' => 'Canada',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Canadian',
|
||||
'timezones' => '[{"zoneName":"America/Atikokan","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America)"},{"zoneName":"America/Blanc-Sablon","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Cambridge_Bay","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Creston","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Dawson","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Dawson_Creek","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Edmonton","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Fort_Nelson","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Glace_Bay","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Goose_Bay","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Halifax","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Inuvik","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Iqaluit","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Moncton","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Nipigon","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Pangnirtung","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Rainy_River","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Rankin_Inlet","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Regina","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Resolute","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/St_Johns","gmtOffset":-12600,"gmtOffsetName":"UTC-03:30","abbreviation":"NST","tzName":"Newfoundland Standard Time"},{"zoneName":"America/Swift_Current","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Thunder_Bay","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Toronto","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Vancouver","gmtOffset":-28800,"gmtOffsetName":"UTC-08:00","abbreviation":"PST","tzName":"Pacific Standard Time (North America"},{"zoneName":"America/Whitehorse","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Winnipeg","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Yellowknife","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"}]',
|
||||
'translations' => '{"kr":"캐나다","pt-BR":"Canadá","pt":"Canadá","nl":"Canada","hr":"Kanada","fa":"کانادا","de":"Kanada","es":"Canadá","fr":"Canada","ja":"カナダ","it":"Canada","cn":"加拿大","tr":"Kanada"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '60';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '95';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇨🇦',
|
||||
'emojiU' => 'U+1F1E8 U+1F1E6',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q16',
|
||||
],
|
||||
[
|
||||
'id' => 86,
|
||||
'name' => 'Greenland',
|
||||
'iso3' => 'GRL',
|
||||
'numeric_code' => '304',
|
||||
'iso2' => 'GL',
|
||||
'phonecode' => '299',
|
||||
'capital' => 'Nuuk',
|
||||
'currency' => 'DKK',
|
||||
'currency_name' => 'Danish krone',
|
||||
'currency_symbol' => 'Kr.',
|
||||
'tld' => '.gl',
|
||||
'native' => 'Kalaallit Nunaat',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Greenlandic',
|
||||
'timezones' => '[{"zoneName":"America/Danmarkshavn","gmtOffset":0,"gmtOffsetName":"UTC±00","abbreviation":"GMT","tzName":"Greenwich Mean Time"},{"zoneName":"America/Nuuk","gmtOffset":-10800,"gmtOffsetName":"UTC-03:00","abbreviation":"WGT","tzName":"West Greenland Time"},{"zoneName":"America/Scoresbysund","gmtOffset":-3600,"gmtOffsetName":"UTC-01:00","abbreviation":"EGT","tzName":"Eastern Greenland Time"},{"zoneName":"America/Thule","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"}]',
|
||||
'translations' => '{"kr":"그린란드","pt-BR":"Groelândia","pt":"Gronelândia","nl":"Groenland","hr":"Grenland","fa":"گرینلند","de":"Grönland","es":"Groenlandia","fr":"Groenland","ja":"グリーンランド","it":"Groenlandia","cn":"格陵兰岛","tr":"Grönland"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '72';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '40';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇬🇱',
|
||||
'emojiU' => 'U+1F1EC U+1F1F1',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 187,
|
||||
'name' => 'Saint Pierre and Miquelon',
|
||||
'iso3' => 'SPM',
|
||||
'numeric_code' => '666',
|
||||
'iso2' => 'PM',
|
||||
'phonecode' => '508',
|
||||
'capital' => 'Saint-Pierre',
|
||||
'currency' => 'EUR',
|
||||
'currency_name' => 'Euro',
|
||||
'currency_symbol' => '€',
|
||||
'tld' => '.pm',
|
||||
'native' => 'Saint-Pierre-et-Miquelon',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Saint-Pierrais or Miquelonnais',
|
||||
'timezones' => '[{"zoneName":"America/Miquelon","gmtOffset":-10800,"gmtOffsetName":"UTC-03:00","abbreviation":"PMDT","tzName":"Pierre & Miquelon Daylight Time"}]',
|
||||
'translations' => '{"kr":"생피에르 미클롱","pt-BR":"Saint-Pierre e Miquelon","pt":"São Pedro e Miquelon","nl":"Saint Pierre en Miquelon","hr":"Sveti Petar i Mikelon","fa":"سن پیر و میکلن","de":"Saint-Pierre und Miquelon","es":"San Pedro y Miquelón","fr":"Saint-Pierre-et-Miquelon","ja":"サンピエール島・ミクロン島","it":"Saint-Pierre e Miquelon","cn":"圣皮埃尔和密克隆","tr":"Saint Pierre Ve Miquelon"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '46';
|
||||
$this->fractionalPart = '83333333';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '56';
|
||||
$this->fractionalPart = '33333333';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇵🇲',
|
||||
'emojiU' => 'U+1F1F5 U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 233,
|
||||
'name' => 'United States',
|
||||
'iso3' => 'USA',
|
||||
'numeric_code' => '840',
|
||||
'iso2' => 'US',
|
||||
'phonecode' => '1',
|
||||
'capital' => 'Washington',
|
||||
'currency' => 'USD',
|
||||
'currency_name' => 'United States dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.us',
|
||||
'native' => 'United States',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'American',
|
||||
'timezones' => '[{"zoneName":"America/Adak","gmtOffset":-36000,"gmtOffsetName":"UTC-10:00","abbreviation":"HST","tzName":"Hawaii–Aleutian Standard Time"},{"zoneName":"America/Anchorage","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Boise","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Chicago","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Denver","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Detroit","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Indianapolis","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Knox","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Indiana/Marengo","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Petersburg","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Tell_City","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Indiana/Vevay","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Vincennes","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Winamac","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Juneau","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Kentucky/Louisville","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Kentucky/Monticello","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Los_Angeles","gmtOffset":-28800,"gmtOffsetName":"UTC-08:00","abbreviation":"PST","tzName":"Pacific Standard Time (North America"},{"zoneName":"America/Menominee","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Metlakatla","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/New_York","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Nome","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/North_Dakota/Beulah","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/North_Dakota/Center","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/North_Dakota/New_Salem","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Phoenix","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Sitka","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Yakutat","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"Pacific/Honolulu","gmtOffset":-36000,"gmtOffsetName":"UTC-10:00","abbreviation":"HST","tzName":"Hawaii–Aleutian Standard Time"}]',
|
||||
'translations' => '{"kr":"미국","pt-BR":"Estados Unidos","pt":"Estados Unidos","nl":"Verenigde Staten","hr":"Sjedinjene Američke Države","fa":"ایالات متحده آمریکا","de":"Vereinigte Staaten von Amerika","es":"Estados Unidos","fr":"États-Unis","ja":"アメリカ合衆国","it":"Stati Uniti D\'America","cn":"美国","tr":"Amerika"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '38';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '97';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇺🇸',
|
||||
'emojiU' => 'U+1F1FA U+1F1F8',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q30',
|
||||
],
|
||||
[
|
||||
'id' => 234,
|
||||
'name' => 'United States Minor Outlying Islands',
|
||||
'iso3' => 'UMI',
|
||||
'numeric_code' => '581',
|
||||
'iso2' => 'UM',
|
||||
'phonecode' => '1',
|
||||
'capital' => '',
|
||||
'currency' => 'USD',
|
||||
'currency_name' => 'United States dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.us',
|
||||
'native' => 'United States Minor Outlying Islands',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'American',
|
||||
'timezones' => '[{"zoneName":"Pacific/Midway","gmtOffset":-39600,"gmtOffsetName":"UTC-11:00","abbreviation":"SST","tzName":"Samoa Standard Time"},{"zoneName":"Pacific/Wake","gmtOffset":43200,"gmtOffsetName":"UTC+12:00","abbreviation":"WAKT","tzName":"Wake Island Time"}]',
|
||||
'translations' => '{"kr":"미국령 군소 제도","pt-BR":"Ilhas Menores Distantes dos Estados Unidos","pt":"Ilhas Menores Distantes dos Estados Unidos","nl":"Kleine afgelegen eilanden van de Verenigde Staten","hr":"Mali udaljeni otoci SAD-a","fa":"جزایر کوچک حاشیهای ایالات متحده آمریکا","de":"Kleinere Inselbesitzungen der Vereinigten Staaten","es":"Islas Ultramarinas Menores de Estados Unidos","fr":"Îles mineures éloignées des États-Unis","ja":"合衆国領有小離島","it":"Isole minori esterne degli Stati Uniti d\'America","cn":"美国本土外小岛屿","tr":"Abd Küçük Harici Adalari"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '0';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '0';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇺🇲',
|
||||
'emojiU' => 'U+1F1FA U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
public function init(): void {
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 25,
|
||||
'name' => 'Bermuda',
|
||||
'iso3' => 'BMU',
|
||||
'numeric_code' => '060',
|
||||
'iso2' => 'BM',
|
||||
'phonecode' => '+1-441',
|
||||
'capital' => 'Hamilton',
|
||||
'currency' => 'BMD',
|
||||
'currency_name' => 'Bermudian dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.bm',
|
||||
'native' => 'Bermuda',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Bermudian, Bermudan',
|
||||
'timezones' => '[{"zoneName":"Atlantic/Bermuda","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"}]',
|
||||
'translations' => '{"kr":"버뮤다","pt-BR":"Bermudas","pt":"Bermudas","nl":"Bermuda","hr":"Bermudi","fa":"برمودا","de":"Bermuda","es":"Bermudas","fr":"Bermudes","ja":"バミューダ","it":"Bermuda","cn":"百慕大","tr":"Bermuda"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '32';
|
||||
$this->fractionalPart = '33333333';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '64';
|
||||
$this->fractionalPart = '75000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇧🇲',
|
||||
'emojiU' => 'U+1F1E7 U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 39,
|
||||
'name' => 'Canada',
|
||||
'iso3' => 'CAN',
|
||||
'numeric_code' => '124',
|
||||
'iso2' => 'CA',
|
||||
'phonecode' => '1',
|
||||
'capital' => 'Ottawa',
|
||||
'currency' => 'CAD',
|
||||
'currency_name' => 'Canadian dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.ca',
|
||||
'native' => 'Canada',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Canadian',
|
||||
'timezones' => '[{"zoneName":"America/Atikokan","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America)"},{"zoneName":"America/Blanc-Sablon","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Cambridge_Bay","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Creston","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Dawson","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Dawson_Creek","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Edmonton","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Fort_Nelson","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America)"},{"zoneName":"America/Glace_Bay","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Goose_Bay","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Halifax","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Inuvik","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Iqaluit","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Moncton","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"},{"zoneName":"America/Nipigon","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Pangnirtung","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Rainy_River","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Rankin_Inlet","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Regina","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Resolute","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/St_Johns","gmtOffset":-12600,"gmtOffsetName":"UTC-03:30","abbreviation":"NST","tzName":"Newfoundland Standard Time"},{"zoneName":"America/Swift_Current","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Thunder_Bay","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Toronto","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Vancouver","gmtOffset":-28800,"gmtOffsetName":"UTC-08:00","abbreviation":"PST","tzName":"Pacific Standard Time (North America"},{"zoneName":"America/Whitehorse","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Winnipeg","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Yellowknife","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"}]',
|
||||
'translations' => '{"kr":"캐나다","pt-BR":"Canadá","pt":"Canadá","nl":"Canada","hr":"Kanada","fa":"کانادا","de":"Kanada","es":"Canadá","fr":"Canada","ja":"カナダ","it":"Canada","cn":"加拿大","tr":"Kanada"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '60';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '95';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇨🇦',
|
||||
'emojiU' => 'U+1F1E8 U+1F1E6',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q16',
|
||||
],
|
||||
[
|
||||
'id' => 86,
|
||||
'name' => 'Greenland',
|
||||
'iso3' => 'GRL',
|
||||
'numeric_code' => '304',
|
||||
'iso2' => 'GL',
|
||||
'phonecode' => '299',
|
||||
'capital' => 'Nuuk',
|
||||
'currency' => 'DKK',
|
||||
'currency_name' => 'Danish krone',
|
||||
'currency_symbol' => 'Kr.',
|
||||
'tld' => '.gl',
|
||||
'native' => 'Kalaallit Nunaat',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Greenlandic',
|
||||
'timezones' => '[{"zoneName":"America/Danmarkshavn","gmtOffset":0,"gmtOffsetName":"UTC±00","abbreviation":"GMT","tzName":"Greenwich Mean Time"},{"zoneName":"America/Nuuk","gmtOffset":-10800,"gmtOffsetName":"UTC-03:00","abbreviation":"WGT","tzName":"West Greenland Time"},{"zoneName":"America/Scoresbysund","gmtOffset":-3600,"gmtOffsetName":"UTC-01:00","abbreviation":"EGT","tzName":"Eastern Greenland Time"},{"zoneName":"America/Thule","gmtOffset":-14400,"gmtOffsetName":"UTC-04:00","abbreviation":"AST","tzName":"Atlantic Standard Time"}]',
|
||||
'translations' => '{"kr":"그린란드","pt-BR":"Groelândia","pt":"Gronelândia","nl":"Groenland","hr":"Grenland","fa":"گرینلند","de":"Grönland","es":"Groenlandia","fr":"Groenland","ja":"グリーンランド","it":"Groenlandia","cn":"格陵兰岛","tr":"Grönland"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '72';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '40';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇬🇱',
|
||||
'emojiU' => 'U+1F1EC U+1F1F1',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-09 06:04:58',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 187,
|
||||
'name' => 'Saint Pierre and Miquelon',
|
||||
'iso3' => 'SPM',
|
||||
'numeric_code' => '666',
|
||||
'iso2' => 'PM',
|
||||
'phonecode' => '508',
|
||||
'capital' => 'Saint-Pierre',
|
||||
'currency' => 'EUR',
|
||||
'currency_name' => 'Euro',
|
||||
'currency_symbol' => '€',
|
||||
'tld' => '.pm',
|
||||
'native' => 'Saint-Pierre-et-Miquelon',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'Saint-Pierrais or Miquelonnais',
|
||||
'timezones' => '[{"zoneName":"America/Miquelon","gmtOffset":-10800,"gmtOffsetName":"UTC-03:00","abbreviation":"PMDT","tzName":"Pierre & Miquelon Daylight Time"}]',
|
||||
'translations' => '{"kr":"생피에르 미클롱","pt-BR":"Saint-Pierre e Miquelon","pt":"São Pedro e Miquelon","nl":"Saint Pierre en Miquelon","hr":"Sveti Petar i Mikelon","fa":"سن پیر و میکلن","de":"Saint-Pierre und Miquelon","es":"San Pedro y Miquelón","fr":"Saint-Pierre-et-Miquelon","ja":"サンピエール島・ミクロン島","it":"Saint-Pierre e Miquelon","cn":"圣皮埃尔和密克隆","tr":"Saint Pierre Ve Miquelon"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '46';
|
||||
$this->fractionalPart = '83333333';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '56';
|
||||
$this->fractionalPart = '33333333';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇵🇲',
|
||||
'emojiU' => 'U+1F1F5 U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
[
|
||||
'id' => 233,
|
||||
'name' => 'United States',
|
||||
'iso3' => 'USA',
|
||||
'numeric_code' => '840',
|
||||
'iso2' => 'US',
|
||||
'phonecode' => '1',
|
||||
'capital' => 'Washington',
|
||||
'currency' => 'USD',
|
||||
'currency_name' => 'United States dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.us',
|
||||
'native' => 'United States',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'American',
|
||||
'timezones' => '[{"zoneName":"America/Adak","gmtOffset":-36000,"gmtOffsetName":"UTC-10:00","abbreviation":"HST","tzName":"Hawaii–Aleutian Standard Time"},{"zoneName":"America/Anchorage","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Boise","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Chicago","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Denver","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Detroit","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Indianapolis","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Knox","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Indiana/Marengo","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Petersburg","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Tell_City","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Indiana/Vevay","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Vincennes","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Indiana/Winamac","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Juneau","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Kentucky/Louisville","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Kentucky/Monticello","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Los_Angeles","gmtOffset":-28800,"gmtOffsetName":"UTC-08:00","abbreviation":"PST","tzName":"Pacific Standard Time (North America"},{"zoneName":"America/Menominee","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Metlakatla","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/New_York","gmtOffset":-18000,"gmtOffsetName":"UTC-05:00","abbreviation":"EST","tzName":"Eastern Standard Time (North America"},{"zoneName":"America/Nome","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/North_Dakota/Beulah","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/North_Dakota/Center","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/North_Dakota/New_Salem","gmtOffset":-21600,"gmtOffsetName":"UTC-06:00","abbreviation":"CST","tzName":"Central Standard Time (North America"},{"zoneName":"America/Phoenix","gmtOffset":-25200,"gmtOffsetName":"UTC-07:00","abbreviation":"MST","tzName":"Mountain Standard Time (North America"},{"zoneName":"America/Sitka","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"America/Yakutat","gmtOffset":-32400,"gmtOffsetName":"UTC-09:00","abbreviation":"AKST","tzName":"Alaska Standard Time"},{"zoneName":"Pacific/Honolulu","gmtOffset":-36000,"gmtOffsetName":"UTC-10:00","abbreviation":"HST","tzName":"Hawaii–Aleutian Standard Time"}]',
|
||||
'translations' => '{"kr":"미국","pt-BR":"Estados Unidos","pt":"Estados Unidos","nl":"Verenigde Staten","hr":"Sjedinjene Američke Države","fa":"ایالات متحده آمریکا","de":"Vereinigte Staaten von Amerika","es":"Estados Unidos","fr":"États-Unis","ja":"アメリカ合衆国","it":"Stati Uniti D\'America","cn":"美国","tr":"Amerika"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '38';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '97';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = true;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇺🇸',
|
||||
'emojiU' => 'U+1F1FA U+1F1F8',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q30',
|
||||
],
|
||||
[
|
||||
'id' => 234,
|
||||
'name' => 'United States Minor Outlying Islands',
|
||||
'iso3' => 'UMI',
|
||||
'numeric_code' => '581',
|
||||
'iso2' => 'UM',
|
||||
'phonecode' => '1',
|
||||
'capital' => '',
|
||||
'currency' => 'USD',
|
||||
'currency_name' => 'United States dollar',
|
||||
'currency_symbol' => '$',
|
||||
'tld' => '.us',
|
||||
'native' => 'United States Minor Outlying Islands',
|
||||
'region' => 'Americas',
|
||||
'region_id' => 2,
|
||||
'subregion' => 'Northern America',
|
||||
'subregion_id' => 6,
|
||||
'nationality' => 'American',
|
||||
'timezones' => '[{"zoneName":"Pacific/Midway","gmtOffset":-39600,"gmtOffsetName":"UTC-11:00","abbreviation":"SST","tzName":"Samoa Standard Time"},{"zoneName":"Pacific/Wake","gmtOffset":43200,"gmtOffsetName":"UTC+12:00","abbreviation":"WAKT","tzName":"Wake Island Time"}]',
|
||||
'translations' => '{"kr":"미국령 군소 제도","pt-BR":"Ilhas Menores Distantes dos Estados Unidos","pt":"Ilhas Menores Distantes dos Estados Unidos","nl":"Kleine afgelegen eilanden van de Verenigde Staten","hr":"Mali udaljeni otoci SAD-a","fa":"جزایر کوچک حاشیهای ایالات متحده آمریکا","de":"Kleinere Inselbesitzungen der Vereinigten Staaten","es":"Islas Ultramarinas Menores de Estados Unidos","fr":"Îles mineures éloignées des États-Unis","ja":"合衆国領有小離島","it":"Isole minori esterne degli Stati Uniti d\'America","cn":"美国本土外小岛屿","tr":"Abd Küçük Harici Adalari"}',
|
||||
'latitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '0';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'longitude' => (static function() {
|
||||
$class = new ReflectionClass(Decimal::class);
|
||||
$object = $class->newInstanceWithoutConstructor();
|
||||
|
||||
(function() {
|
||||
$this->integralPart = '0';
|
||||
$this->fractionalPart = '00000000';
|
||||
$this->negative = false;
|
||||
$this->scale = 8;
|
||||
})->bindTo($object, Decimal::class)();
|
||||
|
||||
return $object;
|
||||
})(),
|
||||
'emoji' => '🇺🇲',
|
||||
'emojiU' => 'U+1F1FA U+1F1F2',
|
||||
'created_at' => '2018-07-21 16:11:03',
|
||||
'updated_at' => '2023-08-10 04:23:19',
|
||||
'flag' => true,
|
||||
'wikiDataId' => null,
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,77 +8,77 @@ use Cake\TestSuite\Fixture\TestFixture;
|
||||
/**
|
||||
* RegionsFixture
|
||||
*/
|
||||
class RegionsFixture extends TestFixture
|
||||
{
|
||||
/**
|
||||
class RegionsFixture extends TestFixture {
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Africa',
|
||||
public function init(): void {
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Africa',
|
||||
// 'translations' => '{"kr":"아프리카","pt-BR":"África","pt":"África","nl":"Afrika","hr":"Afrika","fa":"آفریقا","de":"Afrika","es":"África","fr":"Afrique","ja":"アフリカ","it":"Africa","cn":"非洲","tr":"Afrika"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q15',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Americas',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q15',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Americas',
|
||||
// 'translations' => '{"kr":"아메리카","pt-BR":"América","pt":"América","nl":"Amerika","hr":"Amerika","fa":"قاره آمریکا","de":"Amerika","es":"América","fr":"Amérique","ja":"アメリカ州","it":"America","cn":"美洲","tr":"Amerika"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q828',
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Asia',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q828',
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Asia',
|
||||
// 'translations' => '{"kr":"아시아","pt-BR":"Ásia","pt":"Ásia","nl":"Azië","hr":"Ázsia","fa":"آسیا","de":"Asien","es":"Asia","fr":"Asie","ja":"アジア","it":"Asia","cn":"亚洲","tr":"Asya"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q48',
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'name' => 'Europe',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q48',
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'name' => 'Europe',
|
||||
// 'translations' => '{"kr":"유럽","pt-BR":"Europa","pt":"Europa","nl":"Europa","hr":"Európa","fa":"اروپا","de":"Europa","es":"Europa","fr":"Europe","ja":"ヨーロッパ","it":"Europa","cn":"欧洲","tr":"Avrupa"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q46',
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'name' => 'Oceania',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q46',
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'name' => 'Oceania',
|
||||
// 'translations' => '{"kr":"오세아니아","pt-BR":"Oceania","pt":"Oceania","nl":"Oceanië en Australië","hr":"Óceánia és Ausztrália","fa":"اقیانوسیه","de":"Ozeanien und Australien","es":"Oceanía","fr":"Océanie","ja":"オセアニア","it":"Oceania","cn":"大洋洲","tr":"Okyanusya"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q55643',
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'name' => 'Polar',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q55643',
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'name' => 'Polar',
|
||||
// 'translations' => '{"kr":"남극","pt-BR":"Antártida","pt":"Antártida","nl":"Antarctica","hr":"Antarktika","fa":"جنوبگان","de":"Antarktika","es":"Antártida","fr":"Antarctique","ja":"南極大陸","it":"Antartide","cn":"南極洲","tr":"Antarktika"}',
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q51',
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
'translations' => '',
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-14 14:11:03',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q51',
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,237 +8,237 @@ use Cake\TestSuite\Fixture\TestFixture;
|
||||
/**
|
||||
* SubregionsFixture
|
||||
*/
|
||||
class SubregionsFixture extends TestFixture
|
||||
{
|
||||
/**
|
||||
class SubregionsFixture extends TestFixture {
|
||||
|
||||
/**
|
||||
* Init method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Northern Africa',
|
||||
'translations' => '{"korean":"북아프리카","portuguese":"Norte de África","dutch":"Noord-Afrika","croatian":"Sjeverna Afrika","persian":"شمال آفریقا","german":"Nordafrika","spanish":"Norte de África","french":"Afrique du Nord","japanese":"北アフリカ","italian":"Nordafrica","chinese":"北部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:10:23',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27381',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Middle Africa',
|
||||
'translations' => '{"korean":"중앙아프리카","portuguese":"África Central","dutch":"Centraal-Afrika","croatian":"Srednja Afrika","persian":"مرکز آفریقا","german":"Zentralafrika","spanish":"África Central","french":"Afrique centrale","japanese":"中部アフリカ","italian":"Africa centrale","chinese":"中部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:09',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27433',
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Western Africa',
|
||||
'translations' => '{"korean":"서아프리카","portuguese":"África Ocidental","dutch":"West-Afrika","croatian":"Zapadna Afrika","persian":"غرب آفریقا","german":"Westafrika","spanish":"África Occidental","french":"Afrique de l\'Ouest","japanese":"西アフリカ","italian":"Africa occidentale","chinese":"西非"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:09',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q4412',
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'name' => 'Eastern Africa',
|
||||
'translations' => '{"korean":"동아프리카","portuguese":"África Oriental","dutch":"Oost-Afrika","croatian":"Istočna Afrika","persian":"شرق آفریقا","german":"Ostafrika","spanish":"África Oriental","french":"Afrique de l\'Est","japanese":"東アフリカ","italian":"Africa orientale","chinese":"东部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27407',
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'name' => 'Southern Africa',
|
||||
'translations' => '{"korean":"남아프리카","portuguese":"África Austral","dutch":"Zuidelijk Afrika","croatian":"Južna Afrika","persian":"جنوب آفریقا","german":"Südafrika","spanish":"África austral","french":"Afrique australe","japanese":"南部アフリカ","italian":"Africa australe","chinese":"南部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27394',
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'name' => 'Northern America',
|
||||
'translations' => '{"korean":"북미","portuguese":"América Setentrional","dutch":"Noord-Amerika","persian":"شمال آمریکا","german":"Nordamerika","spanish":"América Norteña","french":"Amérique septentrionale","japanese":"北部アメリカ","italian":"America settentrionale","chinese":"北美地區"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q2017699',
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'name' => 'Caribbean',
|
||||
'translations' => '{"korean":"카리브","portuguese":"Caraíbas","dutch":"Caraïben","croatian":"Karibi","persian":"کارائیب","german":"Karibik","spanish":"Caribe","french":"Caraïbes","japanese":"カリブ海地域","italian":"Caraibi","chinese":"加勒比地区"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q664609',
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'name' => 'South America',
|
||||
'translations' => '{"korean":"남아메리카","portuguese":"América do Sul","dutch":"Zuid-Amerika","croatian":"Južna Amerika","persian":"آمریکای جنوبی","german":"Südamerika","spanish":"América del Sur","french":"Amérique du Sud","japanese":"南アメリカ","italian":"America meridionale","chinese":"南美洲"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q18',
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'name' => 'Central America',
|
||||
'translations' => '{"korean":"중앙아메리카","portuguese":"América Central","dutch":"Centraal-Amerika","croatian":"Srednja Amerika","persian":"آمریکای مرکزی","german":"Zentralamerika","spanish":"América Central","french":"Amérique centrale","japanese":"中央アメリカ","italian":"America centrale","chinese":"中美洲"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27611',
|
||||
],
|
||||
[
|
||||
'id' => 10,
|
||||
'name' => 'Central Asia',
|
||||
'translations' => '{"korean":"중앙아시아","portuguese":"Ásia Central","dutch":"Centraal-Azië","croatian":"Srednja Azija","persian":"آسیای میانه","german":"Zentralasien","spanish":"Asia Central","french":"Asie centrale","japanese":"中央アジア","italian":"Asia centrale","chinese":"中亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27275',
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'name' => 'Western Asia',
|
||||
'translations' => '{"korean":"서아시아","portuguese":"Sudoeste Asiático","dutch":"Zuidwest-Azië","croatian":"Jugozapadna Azija","persian":"غرب آسیا","german":"Vorderasien","spanish":"Asia Occidental","french":"Asie de l\'Ouest","japanese":"西アジア","italian":"Asia occidentale","chinese":"西亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27293',
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'name' => 'Eastern Asia',
|
||||
'translations' => '{"korean":"동아시아","portuguese":"Ásia Oriental","dutch":"Oost-Azië","croatian":"Istočna Azija","persian":"شرق آسیا","german":"Ostasien","spanish":"Asia Oriental","french":"Asie de l\'Est","japanese":"東アジア","italian":"Asia orientale","chinese":"東亞"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27231',
|
||||
],
|
||||
[
|
||||
'id' => 13,
|
||||
'name' => 'South-Eastern Asia',
|
||||
'translations' => '{"korean":"동남아시아","portuguese":"Sudeste Asiático","dutch":"Zuidoost-Azië","croatian":"Jugoistočna Azija","persian":"جنوب شرق آسیا","german":"Südostasien","spanish":"Sudeste Asiático","french":"Asie du Sud-Est","japanese":"東南アジア","italian":"Sud-est asiatico","chinese":"东南亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q11708',
|
||||
],
|
||||
[
|
||||
'id' => 14,
|
||||
'name' => 'Southern Asia',
|
||||
'translations' => '{"korean":"남아시아","portuguese":"Ásia Meridional","dutch":"Zuid-Azië","croatian":"Južna Azija","persian":"جنوب آسیا","german":"Südasien","spanish":"Asia del Sur","french":"Asie du Sud","japanese":"南アジア","italian":"Asia meridionale","chinese":"南亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q771405',
|
||||
],
|
||||
[
|
||||
'id' => 15,
|
||||
'name' => 'Eastern Europe',
|
||||
'translations' => '{"korean":"동유럽","portuguese":"Europa de Leste","dutch":"Oost-Europa","croatian":"Istočna Europa","persian":"شرق اروپا","german":"Osteuropa","spanish":"Europa Oriental","french":"Europe de l\'Est","japanese":"東ヨーロッパ","italian":"Europa orientale","chinese":"东欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27468',
|
||||
],
|
||||
[
|
||||
'id' => 16,
|
||||
'name' => 'Southern Europe',
|
||||
'translations' => '{"korean":"남유럽","portuguese":"Europa meridional","dutch":"Zuid-Europa","croatian":"Južna Europa","persian":"جنوب اروپا","german":"Südeuropa","spanish":"Europa del Sur","french":"Europe du Sud","japanese":"南ヨーロッパ","italian":"Europa meridionale","chinese":"南欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27449',
|
||||
],
|
||||
[
|
||||
'id' => 17,
|
||||
'name' => 'Western Europe',
|
||||
'translations' => '{"korean":"서유럽","portuguese":"Europa Ocidental","dutch":"West-Europa","croatian":"Zapadna Europa","persian":"غرب اروپا","german":"Westeuropa","spanish":"Europa Occidental","french":"Europe de l\'Ouest","japanese":"西ヨーロッパ","italian":"Europa occidentale","chinese":"西欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27496',
|
||||
],
|
||||
[
|
||||
'id' => 18,
|
||||
'name' => 'Northern Europe',
|
||||
'translations' => '{"korean":"북유럽","portuguese":"Europa Setentrional","dutch":"Noord-Europa","croatian":"Sjeverna Europa","persian":"شمال اروپا","german":"Nordeuropa","spanish":"Europa del Norte","french":"Europe du Nord","japanese":"北ヨーロッパ","italian":"Europa settentrionale","chinese":"北歐"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27479',
|
||||
],
|
||||
[
|
||||
'id' => 19,
|
||||
'name' => 'Australia and New Zealand',
|
||||
'translations' => '{"korean":"오스트랄라시아","portuguese":"Australásia","dutch":"Australazië","croatian":"Australazija","persian":"استرالزی","german":"Australasien","spanish":"Australasia","french":"Australasie","japanese":"オーストララシア","italian":"Australasia","chinese":"澳大拉西亞"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q45256',
|
||||
],
|
||||
[
|
||||
'id' => 20,
|
||||
'name' => 'Melanesia',
|
||||
'translations' => '{"korean":"멜라네시아","portuguese":"Melanésia","dutch":"Melanesië","croatian":"Melanezija","persian":"ملانزی","german":"Melanesien","spanish":"Melanesia","french":"Mélanésie","japanese":"メラネシア","italian":"Melanesia","chinese":"美拉尼西亚"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q37394',
|
||||
],
|
||||
[
|
||||
'id' => 21,
|
||||
'name' => 'Micronesia',
|
||||
'translations' => '{"korean":"미크로네시아","portuguese":"Micronésia","dutch":"Micronesië","croatian":"Mikronezija","persian":"میکرونزی","german":"Mikronesien","spanish":"Micronesia","french":"Micronésie","japanese":"ミクロネシア","italian":"Micronesia","chinese":"密克罗尼西亚群岛"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q3359409',
|
||||
],
|
||||
[
|
||||
'id' => 22,
|
||||
'name' => 'Polynesia',
|
||||
'translations' => '{"korean":"폴리네시아","portuguese":"Polinésia","dutch":"Polynesië","croatian":"Polinezija","persian":"پلینزی","german":"Polynesien","spanish":"Polinesia","french":"Polynésie","japanese":"ポリネシア","italian":"Polinesia","chinese":"玻里尼西亞"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q35942',
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
public function init(): void {
|
||||
$this->records = [
|
||||
[
|
||||
'id' => 1,
|
||||
'name' => 'Northern Africa',
|
||||
'translations' => '{"korean":"북아프리카","portuguese":"Norte de África","dutch":"Noord-Afrika","croatian":"Sjeverna Afrika","persian":"شمال آفریقا","german":"Nordafrika","spanish":"Norte de África","french":"Afrique du Nord","japanese":"北アフリカ","italian":"Nordafrica","chinese":"北部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:10:23',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27381',
|
||||
],
|
||||
[
|
||||
'id' => 2,
|
||||
'name' => 'Middle Africa',
|
||||
'translations' => '{"korean":"중앙아프리카","portuguese":"África Central","dutch":"Centraal-Afrika","croatian":"Srednja Afrika","persian":"مرکز آفریقا","german":"Zentralafrika","spanish":"África Central","french":"Afrique centrale","japanese":"中部アフリカ","italian":"Africa centrale","chinese":"中部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:09',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27433',
|
||||
],
|
||||
[
|
||||
'id' => 3,
|
||||
'name' => 'Western Africa',
|
||||
'translations' => '{"korean":"서아프리카","portuguese":"África Ocidental","dutch":"West-Afrika","croatian":"Zapadna Afrika","persian":"غرب آفریقا","german":"Westafrika","spanish":"África Occidental","french":"Afrique de l\'Ouest","japanese":"西アフリカ","italian":"Africa occidentale","chinese":"西非"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:09',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q4412',
|
||||
],
|
||||
[
|
||||
'id' => 4,
|
||||
'name' => 'Eastern Africa',
|
||||
'translations' => '{"korean":"동아프리카","portuguese":"África Oriental","dutch":"Oost-Afrika","croatian":"Istočna Afrika","persian":"شرق آفریقا","german":"Ostafrika","spanish":"África Oriental","french":"Afrique de l\'Est","japanese":"東アフリカ","italian":"Africa orientale","chinese":"东部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27407',
|
||||
],
|
||||
[
|
||||
'id' => 5,
|
||||
'name' => 'Southern Africa',
|
||||
'translations' => '{"korean":"남아프리카","portuguese":"África Austral","dutch":"Zuidelijk Afrika","croatian":"Južna Afrika","persian":"جنوب آفریقا","german":"Südafrika","spanish":"África austral","french":"Afrique australe","japanese":"南部アフリカ","italian":"Africa australe","chinese":"南部非洲"}',
|
||||
'region_id' => 1,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27394',
|
||||
],
|
||||
[
|
||||
'id' => 6,
|
||||
'name' => 'Northern America',
|
||||
'translations' => '{"korean":"북미","portuguese":"América Setentrional","dutch":"Noord-Amerika","persian":"شمال آمریکا","german":"Nordamerika","spanish":"América Norteña","french":"Amérique septentrionale","japanese":"北部アメリカ","italian":"America settentrionale","chinese":"北美地區"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q2017699',
|
||||
],
|
||||
[
|
||||
'id' => 7,
|
||||
'name' => 'Caribbean',
|
||||
'translations' => '{"korean":"카리브","portuguese":"Caraíbas","dutch":"Caraïben","croatian":"Karibi","persian":"کارائیب","german":"Karibik","spanish":"Caribe","french":"Caraïbes","japanese":"カリブ海地域","italian":"Caraibi","chinese":"加勒比地区"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q664609',
|
||||
],
|
||||
[
|
||||
'id' => 8,
|
||||
'name' => 'South America',
|
||||
'translations' => '{"korean":"남아메리카","portuguese":"América do Sul","dutch":"Zuid-Amerika","croatian":"Južna Amerika","persian":"آمریکای جنوبی","german":"Südamerika","spanish":"América del Sur","french":"Amérique du Sud","japanese":"南アメリカ","italian":"America meridionale","chinese":"南美洲"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:10',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q18',
|
||||
],
|
||||
[
|
||||
'id' => 9,
|
||||
'name' => 'Central America',
|
||||
'translations' => '{"korean":"중앙아메리카","portuguese":"América Central","dutch":"Centraal-Amerika","croatian":"Srednja Amerika","persian":"آمریکای مرکزی","german":"Zentralamerika","spanish":"América Central","french":"Amérique centrale","japanese":"中央アメリカ","italian":"America centrale","chinese":"中美洲"}',
|
||||
'region_id' => 2,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27611',
|
||||
],
|
||||
[
|
||||
'id' => 10,
|
||||
'name' => 'Central Asia',
|
||||
'translations' => '{"korean":"중앙아시아","portuguese":"Ásia Central","dutch":"Centraal-Azië","croatian":"Srednja Azija","persian":"آسیای میانه","german":"Zentralasien","spanish":"Asia Central","french":"Asie centrale","japanese":"中央アジア","italian":"Asia centrale","chinese":"中亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27275',
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'name' => 'Western Asia',
|
||||
'translations' => '{"korean":"서아시아","portuguese":"Sudoeste Asiático","dutch":"Zuidwest-Azië","croatian":"Jugozapadna Azija","persian":"غرب آسیا","german":"Vorderasien","spanish":"Asia Occidental","french":"Asie de l\'Ouest","japanese":"西アジア","italian":"Asia occidentale","chinese":"西亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27293',
|
||||
],
|
||||
[
|
||||
'id' => 12,
|
||||
'name' => 'Eastern Asia',
|
||||
'translations' => '{"korean":"동아시아","portuguese":"Ásia Oriental","dutch":"Oost-Azië","croatian":"Istočna Azija","persian":"شرق آسیا","german":"Ostasien","spanish":"Asia Oriental","french":"Asie de l\'Est","japanese":"東アジア","italian":"Asia orientale","chinese":"東亞"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:11',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27231',
|
||||
],
|
||||
[
|
||||
'id' => 13,
|
||||
'name' => 'South-Eastern Asia',
|
||||
'translations' => '{"korean":"동남아시아","portuguese":"Sudeste Asiático","dutch":"Zuidoost-Azië","croatian":"Jugoistočna Azija","persian":"جنوب شرق آسیا","german":"Südostasien","spanish":"Sudeste Asiático","french":"Asie du Sud-Est","japanese":"東南アジア","italian":"Sud-est asiatico","chinese":"东南亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q11708',
|
||||
],
|
||||
[
|
||||
'id' => 14,
|
||||
'name' => 'Southern Asia',
|
||||
'translations' => '{"korean":"남아시아","portuguese":"Ásia Meridional","dutch":"Zuid-Azië","croatian":"Južna Azija","persian":"جنوب آسیا","german":"Südasien","spanish":"Asia del Sur","french":"Asie du Sud","japanese":"南アジア","italian":"Asia meridionale","chinese":"南亚"}',
|
||||
'region_id' => 3,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q771405',
|
||||
],
|
||||
[
|
||||
'id' => 15,
|
||||
'name' => 'Eastern Europe',
|
||||
'translations' => '{"korean":"동유럽","portuguese":"Europa de Leste","dutch":"Oost-Europa","croatian":"Istočna Europa","persian":"شرق اروپا","german":"Osteuropa","spanish":"Europa Oriental","french":"Europe de l\'Est","japanese":"東ヨーロッパ","italian":"Europa orientale","chinese":"东欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27468',
|
||||
],
|
||||
[
|
||||
'id' => 16,
|
||||
'name' => 'Southern Europe',
|
||||
'translations' => '{"korean":"남유럽","portuguese":"Europa meridional","dutch":"Zuid-Europa","croatian":"Južna Europa","persian":"جنوب اروپا","german":"Südeuropa","spanish":"Europa del Sur","french":"Europe du Sud","japanese":"南ヨーロッパ","italian":"Europa meridionale","chinese":"南欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27449',
|
||||
],
|
||||
[
|
||||
'id' => 17,
|
||||
'name' => 'Western Europe',
|
||||
'translations' => '{"korean":"서유럽","portuguese":"Europa Ocidental","dutch":"West-Europa","croatian":"Zapadna Europa","persian":"غرب اروپا","german":"Westeuropa","spanish":"Europa Occidental","french":"Europe de l\'Ouest","japanese":"西ヨーロッパ","italian":"Europa occidentale","chinese":"西欧"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:12',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27496',
|
||||
],
|
||||
[
|
||||
'id' => 18,
|
||||
'name' => 'Northern Europe',
|
||||
'translations' => '{"korean":"북유럽","portuguese":"Europa Setentrional","dutch":"Noord-Europa","croatian":"Sjeverna Europa","persian":"شمال اروپا","german":"Nordeuropa","spanish":"Europa del Norte","french":"Europe du Nord","japanese":"北ヨーロッパ","italian":"Europa settentrionale","chinese":"北歐"}',
|
||||
'region_id' => 4,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q27479',
|
||||
],
|
||||
[
|
||||
'id' => 19,
|
||||
'name' => 'Australia and New Zealand',
|
||||
'translations' => '{"korean":"오스트랄라시아","portuguese":"Australásia","dutch":"Australazië","croatian":"Australazija","persian":"استرالزی","german":"Australasien","spanish":"Australasia","french":"Australasie","japanese":"オーストララシア","italian":"Australasia","chinese":"澳大拉西亞"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q45256',
|
||||
],
|
||||
[
|
||||
'id' => 20,
|
||||
'name' => 'Melanesia',
|
||||
'translations' => '{"korean":"멜라네시아","portuguese":"Melanésia","dutch":"Melanesië","croatian":"Melanezija","persian":"ملانزی","german":"Melanesien","spanish":"Melanesia","french":"Mélanésie","japanese":"メラネシア","italian":"Melanesia","chinese":"美拉尼西亚"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q37394',
|
||||
],
|
||||
[
|
||||
'id' => 21,
|
||||
'name' => 'Micronesia',
|
||||
'translations' => '{"korean":"미크로네시아","portuguese":"Micronésia","dutch":"Micronesië","croatian":"Mikronezija","persian":"میکرونزی","german":"Mikronesien","spanish":"Micronesia","french":"Micronésie","japanese":"ミクロネシア","italian":"Micronesia","chinese":"密克罗尼西亚群岛"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q3359409',
|
||||
],
|
||||
[
|
||||
'id' => 22,
|
||||
'name' => 'Polynesia',
|
||||
'translations' => '{"korean":"폴리네시아","portuguese":"Polinésia","dutch":"Polynesië","croatian":"Polinezija","persian":"پلینزی","german":"Polynesien","spanish":"Polinesia","french":"Polynésie","japanese":"ポリネシア","italian":"Polinesia","chinese":"玻里尼西亞"}',
|
||||
'region_id' => 5,
|
||||
'created_at' => '2023-08-14 14:11:03',
|
||||
'updated_at' => '2023-08-25 03:22:13',
|
||||
'flag' => true,
|
||||
'wikiDataId' => 'Q35942',
|
||||
],
|
||||
];
|
||||
parent::init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,347 +3,333 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use CakeAddresses\Controller\AddressesController;
|
||||
use CakeAddresses\Model\Table\AddressesTable;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\AddressesController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController
|
||||
*/
|
||||
class AddressesControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class AddressesControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* Addresses Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\AddressesTable
|
||||
*/
|
||||
protected $Addresses;
|
||||
protected $Addresses;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
// 'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
// 'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.States',
|
||||
// 'plugin.CakeAddresses.Subregions',
|
||||
];
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->Addresses = $this->getTableLocator()->get('CakeAddresses.Addresses');
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->Addresses = $this->getTableLocator()->get('CakeAddresses.Addresses');
|
||||
// $this->enableCsrfToken();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Addresses);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Addresses);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* Tests the index action with an unauthenticated user (not logged in)
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::index()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndexGet(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testIndexGet(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* Tests the view action with an unauthenticated user (not logged in)
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::view()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewGet(): void
|
||||
{
|
||||
$id = 1;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testViewGet(): void {
|
||||
$id = 1;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test add method
|
||||
*
|
||||
* Tests the add action with an unauthenticated user (not logged in)
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::add()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAddGet(): void
|
||||
{
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
public function testAddGet(): void {
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore, $cntAfter);
|
||||
}
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore, $cntAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test add method
|
||||
*
|
||||
* Tests a POST request to the add action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::add()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAddPostSuccess(): void
|
||||
{
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
public function testAddPostSuccess(): void {
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
|
||||
$this->loginUserByRole();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$data = [
|
||||
'address_name' => 'new address',
|
||||
'contact_name' => 'john doe',
|
||||
'address_line1' => '123 Test ST',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->post($url, $data);
|
||||
$this->assertResponseCode(302);
|
||||
$this->assertRedirectContains('addresses');
|
||||
$this->loginUserByRole();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$data = [
|
||||
'address_name' => 'new address',
|
||||
'contact_name' => 'john doe',
|
||||
'address_line1' => '123 Test ST',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->post($url, $data);
|
||||
$this->assertResponseCode(302);
|
||||
$this->assertRedirectContains('addresses');
|
||||
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore + 1, $cntAfter);
|
||||
}
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore + 1, $cntAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test add method
|
||||
*
|
||||
* Tests a POST request to the add action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::add()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testAddPostFailure(): void
|
||||
{
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
public function testAddPostFailure(): void {
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
|
||||
$this->loginUserByRole();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$data = [
|
||||
'address_name' => '',
|
||||
'contact_name' => '',
|
||||
'address_line1' => '',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->post($url, $data);
|
||||
$this->assertResponseCode(200);
|
||||
$this->loginUserByRole();
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add',
|
||||
];
|
||||
$data = [
|
||||
'address_name' => '',
|
||||
'contact_name' => '',
|
||||
'address_line1' => '',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->post($url, $data);
|
||||
$this->assertResponseCode(200);
|
||||
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore, $cntAfter);
|
||||
}
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore, $cntAfter);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test edit method
|
||||
*
|
||||
* Tests the edit action with an unauthenticated user (not logged in)
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::edit()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEditGet(): void
|
||||
{
|
||||
$id = 1;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testEditGet(): void {
|
||||
$id = 1;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test edit method
|
||||
*
|
||||
* Tests a PUT request to the edit action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::edit()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEditPutSuccess(): void
|
||||
{
|
||||
$this->loginUserByRole();
|
||||
$id = 1;
|
||||
$before = $this->Addresses->get($id);
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$data = [
|
||||
// test new data here
|
||||
'address_name' => 'new address',
|
||||
'contact_name' => 'john doe',
|
||||
'address_line1' => '123 Test ST',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->put($url, $data);
|
||||
public function testEditPutSuccess(): void {
|
||||
$this->loginUserByRole();
|
||||
$id = 1;
|
||||
$before = $this->Addresses->get($id);
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$data = [
|
||||
// test new data here
|
||||
'address_name' => 'new address',
|
||||
'contact_name' => 'john doe',
|
||||
'address_line1' => '123 Test ST',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->put($url, $data);
|
||||
|
||||
$this->assertResponseCode(302);
|
||||
$this->assertRedirectContains('addresses');
|
||||
$this->assertResponseCode(302);
|
||||
$this->assertRedirectContains('addresses');
|
||||
|
||||
$after = $this->Addresses->get($id);
|
||||
// assert saved properly below
|
||||
}
|
||||
$after = $this->Addresses->get($id);
|
||||
// assert saved properly below
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test edit method
|
||||
*
|
||||
* Tests a PUT request to the edit action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::edit()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testEditPutFailure(): void
|
||||
{
|
||||
$id = 1;
|
||||
$before = $this->Addresses->get($id);
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$data = [
|
||||
'address_name' => '',
|
||||
'contact_name' => '',
|
||||
'address_line1' => '',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->put($url, $data);
|
||||
$this->assertResponseCode(200);
|
||||
$after = $this->Addresses->get($id);
|
||||
public function testEditPutFailure(): void {
|
||||
$id = 1;
|
||||
$before = $this->Addresses->get($id);
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$id,
|
||||
];
|
||||
$data = [
|
||||
'address_name' => '',
|
||||
'contact_name' => '',
|
||||
'address_line1' => '',
|
||||
'address_line2' => '',
|
||||
'city' => 'Seattle',
|
||||
'city_id' => '',
|
||||
'state_id' => 1462,
|
||||
'postal_code' => '98056',
|
||||
'country_id' => 233,
|
||||
'phone_number' => '',
|
||||
'email' => '',
|
||||
'notes' => '',
|
||||
];
|
||||
$this->put($url, $data);
|
||||
$this->assertResponseCode(200);
|
||||
$after = $this->Addresses->get($id);
|
||||
|
||||
// assert save failed below
|
||||
}
|
||||
// assert save failed below
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test delete method
|
||||
*
|
||||
* Tests the delete action with an unauthenticated user (not logged in)
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\AddressesController::delete()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDelete(): void
|
||||
{
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
public function testDelete(): void {
|
||||
$cntBefore = $this->Addresses->find()->count();
|
||||
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'delete',
|
||||
1,
|
||||
];
|
||||
$this->delete($url);
|
||||
$this->assertResponseCode(302);
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'delete',
|
||||
1,
|
||||
];
|
||||
$this->delete($url);
|
||||
$this->assertResponseCode(302);
|
||||
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore - 1, $cntAfter);
|
||||
}
|
||||
|
||||
$cntAfter = $this->Addresses->find()->count();
|
||||
$this->assertEquals($cntBefore - 1, $cntAfter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,21 +5,24 @@ namespace CakeAddresses\Test\TestCase\Controller;
|
||||
use Cake\TestSuite\IntegrationTestTrait;
|
||||
use Cake\TestSuite\TestCase;
|
||||
|
||||
class BaseControllerTest extends TestCase
|
||||
{
|
||||
use IntegrationTestTrait;
|
||||
class BaseControllerTest extends TestCase {
|
||||
|
||||
public function loginUserByRole(string $role = 'admin'): void
|
||||
{
|
||||
$this->session(['Auth.User.id' => 1]);
|
||||
$this->session(['Auth.id' => 1]);
|
||||
}
|
||||
use IntegrationTestTrait;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param string $role - role name - makes testing different roles easier
|
||||
* @return void
|
||||
*/
|
||||
public function testTest()
|
||||
{
|
||||
$this->assertEquals(1, 1);
|
||||
}
|
||||
public function loginUserByRole(string $role = 'admin'): void {
|
||||
$this->session(['Auth.User.id' => 1]);
|
||||
$this->session(['Auth.id' => 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testTest() {
|
||||
$this->assertEquals(1, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,77 +3,72 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use CakeAddresses\Controller\CitiesController;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\CitiesController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\CitiesController
|
||||
*/
|
||||
class CitiesControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class CitiesControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* Cities Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\CitiesTable
|
||||
*/
|
||||
protected $Cities;
|
||||
protected $Cities;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
protected array $fixtures = [
|
||||
// 'plugin.CakeAddresses.Regions',
|
||||
// 'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->Cities = $this->getTableLocator()->get('CakeAddresses.Cities');
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->Cities = $this->getTableLocator()->get('CakeAddresses.Cities');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Cities);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Cities);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test select method
|
||||
*
|
||||
* Tests the select action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\CitiesController::select()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSelect(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Cities',
|
||||
'action' => 'select',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testSelect(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Cities',
|
||||
'action' => 'select',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,100 +3,94 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use CakeAddresses\Controller\CountriesController;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\CountriesController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\CountriesController
|
||||
*/
|
||||
class CountriesControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class CountriesControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* AnsibleGroups Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\CountriesTable
|
||||
*/
|
||||
protected $Countries;
|
||||
protected $Countries;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
// 'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->Countries = $this->getTableLocator()->get('CakeAddresses.Countries');
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->Countries = $this->getTableLocator()->get('CakeAddresses.Countries');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Countries);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Countries);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* Tests the index action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\CountriesController::index()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndexGet(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Countries',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testIndexGet(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Countries',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* Tests the view action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\CountriesController::view()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewGet(): void
|
||||
{
|
||||
$id = 233;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Countries',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testViewGet(): void {
|
||||
$id = 233;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Countries',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,103 +3,95 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use Cake\TestSuite\IntegrationTestTrait;
|
||||
use Cake\TestSuite\TestCase;
|
||||
use CakeAddresses\Controller\RegionsController;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\RegionsController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\RegionsController
|
||||
*/
|
||||
class RegionsControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class RegionsControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* Regions Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\RegionsTable
|
||||
*/
|
||||
protected $Regions;
|
||||
protected $Regions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
// 'plugin.CakeAddresses.Subregions',
|
||||
// 'plugin.CakeAddresses.Countries',
|
||||
// 'plugin.CakeAddresses.States',
|
||||
// 'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->Regions = $this->getTableLocator()->get('CakeAddresses.Regions');
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->Regions = $this->getTableLocator()->get('CakeAddresses.Regions');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Regions);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Regions);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* Tests the index action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\RegionsController::index()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndexGet(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Regions',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testIndexGet(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Regions',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* Tests the view action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\RegionsController::view()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewGet(): void
|
||||
{
|
||||
$id = 1;
|
||||
public function testViewGet(): void {
|
||||
$id = 1;
|
||||
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Regions',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Regions',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,99 +3,94 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use CakeAddresses\Controller\StatesController;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\StatesController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\StatesController
|
||||
*/
|
||||
class StatesControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class StatesControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* States Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\StatesTable
|
||||
*/
|
||||
protected $States;
|
||||
/**
|
||||
protected $States;
|
||||
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
protected array $fixtures = [
|
||||
// 'plugin.CakeAddresses.Regions',
|
||||
// 'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.States',
|
||||
// 'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->States = $this->getTableLocator()->get('CakeAddresses.States');
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->States = $this->getTableLocator()->get('CakeAddresses.States');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->States);
|
||||
protected function tearDown(): void {
|
||||
unset($this->States);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* Tests the index action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\StatesController::index()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndexGet(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'States',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testIndexGet(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'States',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* Tests the view action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\StatesController::view()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewGet(): void
|
||||
{
|
||||
$id = 1462;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'States',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testViewGet(): void {
|
||||
$id = 1462;
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'States',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,104 +3,96 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeAddresses\Test\TestCase\Controller;
|
||||
|
||||
use Cake\TestSuite\IntegrationTestTrait;
|
||||
use Cake\TestSuite\TestCase;
|
||||
use CakeAddresses\Controller\SubregionsController;
|
||||
use PHPUnit\Exception;
|
||||
|
||||
/**
|
||||
* CakeAddresses\Controller\SubregionsController Test Case
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\SubregionsController
|
||||
*/
|
||||
class SubregionsControllerTest extends BaseControllerTest
|
||||
{
|
||||
/**
|
||||
class SubregionsControllerTest extends BaseControllerTest {
|
||||
|
||||
/**
|
||||
* Subregions Table
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\SubregionsTable
|
||||
*/
|
||||
protected $Subregions;
|
||||
protected $Subregions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
// 'plugin.CakeAddresses.States',
|
||||
// 'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->Subregions = $this->getTableLocator()->get('CakeAddresses.Subregions');
|
||||
$this->enableCsrfToken();
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$this->Subregions = $this->getTableLocator()->get('CakeAddresses.Subregions');
|
||||
$this->enableCsrfToken();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Subregions);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Subregions);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test index method
|
||||
*
|
||||
* Tests the index action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\SubregionsController::index()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIndexGet(): void
|
||||
{
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Subregions',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
public function testIndexGet(): void {
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Subregions',
|
||||
'action' => 'index',
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test view method
|
||||
*
|
||||
* Tests the view action with a logged in user
|
||||
*
|
||||
* @uses \CakeAddresses\Controller\SubregionsController::view()
|
||||
* @throws Exception
|
||||
* @throws \PHPUnit\Exception
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testViewGet(): void
|
||||
{
|
||||
$id = 1;
|
||||
public function testViewGet(): void {
|
||||
$id = 1;
|
||||
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Subregions',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
|
||||
$url = [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Subregions',
|
||||
'action' => 'view',
|
||||
$id,
|
||||
];
|
||||
$this->get($url);
|
||||
$this->assertResponseCode(200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,103 +9,97 @@ use CakeAddresses\Model\Table\AddressesTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\AddressesTable Test Case
|
||||
*/
|
||||
class AddressesTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class AddressesTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\AddressesTable
|
||||
*/
|
||||
protected $Addresses;
|
||||
protected $Addresses;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Addresses') ? [] : ['className' => AddressesTable::class];
|
||||
$this->Addresses = $this->getTableLocator()->get('Addresses', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Addresses') ? [] : ['className' => AddressesTable::class];
|
||||
$this->Addresses = $this->getTableLocator()->get('Addresses', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* TestInitialize method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\AddressesTable::initialize()
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize(): void
|
||||
{
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'Cities',
|
||||
'States',
|
||||
'Countries',
|
||||
];
|
||||
$associations = $this->Addresses->associations();
|
||||
public function testInitialize(): void {
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'Cities',
|
||||
'States',
|
||||
'Countries',
|
||||
];
|
||||
$associations = $this->Addresses->associations();
|
||||
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Addresses->hasAssociation($expectedAssociation), 'Failed asserting Addresses has the association: ' . $expectedAssociation);
|
||||
}
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Addresses->hasAssociation($expectedAssociation), 'Failed asserting Addresses has the association: ' . $expectedAssociation);
|
||||
}
|
||||
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [
|
||||
];
|
||||
$behaviors = $this->Addresses->behaviors();
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [];
|
||||
$behaviors = $this->Addresses->behaviors();
|
||||
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Addresses->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Addresses->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Addresses);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Addresses);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\AddressesTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\AddressesTable::buildRules()
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,103 +9,97 @@ use CakeAddresses\Model\Table\CitiesTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\CitiesTable Test Case
|
||||
*/
|
||||
class CitiesTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class CitiesTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\CitiesTable
|
||||
*/
|
||||
protected $Cities;
|
||||
protected $Cities;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Cities') ? [] : ['className' => CitiesTable::class];
|
||||
$this->Cities = $this->getTableLocator()->get('Cities', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Cities') ? [] : ['className' => CitiesTable::class];
|
||||
$this->Cities = $this->getTableLocator()->get('Cities', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Cities);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Cities);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* TestInitialize method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\CitiesTable::initialize()
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize(): void
|
||||
{
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'States',
|
||||
'Countries',
|
||||
'Addresses',
|
||||
];
|
||||
$associations = $this->Cities->associations();
|
||||
public function testInitialize(): void {
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'States',
|
||||
'Countries',
|
||||
'Addresses',
|
||||
];
|
||||
$associations = $this->Cities->associations();
|
||||
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Cities->hasAssociation($expectedAssociation), 'Failed asserting Cities has the association: ' . $expectedAssociation);
|
||||
}
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Cities->hasAssociation($expectedAssociation), 'Failed asserting Cities has the association: ' . $expectedAssociation);
|
||||
}
|
||||
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [
|
||||
];
|
||||
$behaviors = $this->Cities->behaviors();
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [];
|
||||
$behaviors = $this->Cities->behaviors();
|
||||
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Cities->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Cities->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\CitiesTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\CitiesTable::buildRules()
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,72 +9,69 @@ use CakeAddresses\Model\Table\CountriesTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\CountriesTable Test Case
|
||||
*/
|
||||
class CountriesTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class CountriesTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\CountriesTable
|
||||
*/
|
||||
protected $Countries;
|
||||
protected $Countries;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
'plugin.CakeAddresses.States',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Countries') ? [] : ['className' => CountriesTable::class];
|
||||
$this->Countries = $this->getTableLocator()->get('Countries', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Countries') ? [] : ['className' => CountriesTable::class];
|
||||
$this->Countries = $this->getTableLocator()->get('Countries', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Countries);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Countries);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\CountriesTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\CountriesTable::buildRules()
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,89 +9,86 @@ use CakeAddresses\Model\Table\RegionsTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\RegionsTable Test Case
|
||||
*/
|
||||
class RegionsTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class RegionsTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\RegionsTable
|
||||
*/
|
||||
protected $Regions;
|
||||
protected $Regions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Regions') ? [] : ['className' => RegionsTable::class];
|
||||
$this->Regions = $this->getTableLocator()->get('Regions', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Regions') ? [] : ['className' => RegionsTable::class];
|
||||
$this->Regions = $this->getTableLocator()->get('Regions', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Regions);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Regions);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* TestInitialize method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\RegionsTable::initialize()
|
||||
* @return void
|
||||
*/
|
||||
public function testInitialize(): void
|
||||
{
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'Countries',
|
||||
'Subregions',
|
||||
public function testInitialize(): void {
|
||||
// verify all associations loaded
|
||||
$expectedAssociations = [
|
||||
'Countries',
|
||||
'Subregions',
|
||||
// 'States',
|
||||
];
|
||||
$associations = $this->Regions->associations();
|
||||
];
|
||||
$associations = $this->Regions->associations();
|
||||
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Regions->hasAssociation($expectedAssociation));
|
||||
}
|
||||
$this->assertCount(count($expectedAssociations), $associations);
|
||||
foreach ($expectedAssociations as $expectedAssociation) {
|
||||
$this->assertTrue($this->Regions->hasAssociation($expectedAssociation));
|
||||
}
|
||||
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [];
|
||||
$behaviors = $this->Regions->behaviors();
|
||||
// verify all behaviors loaded
|
||||
$expectedBehaviors = [];
|
||||
$behaviors = $this->Regions->behaviors();
|
||||
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Regions->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
$this->assertCount(count($expectedBehaviors), $behaviors);
|
||||
foreach ($expectedBehaviors as $expectedBehavior) {
|
||||
$this->assertTrue($this->Regions->hasBehavior($expectedBehavior));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\RegionsTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,70 +9,67 @@ use CakeAddresses\Model\Table\StatesTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\StatesTable Test Case
|
||||
*/
|
||||
class StatesTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class StatesTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\StatesTable
|
||||
*/
|
||||
protected $States;
|
||||
protected $States;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.States',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
'plugin.CakeAddresses.Addresses',
|
||||
'plugin.CakeAddresses.Cities',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('States') ? [] : ['className' => StatesTable::class];
|
||||
$this->States = $this->getTableLocator()->get('States', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('States') ? [] : ['className' => StatesTable::class];
|
||||
$this->States = $this->getTableLocator()->get('States', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->States);
|
||||
protected function tearDown(): void {
|
||||
unset($this->States);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\StatesTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\StatesTable::buildRules()
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,69 +9,66 @@ use CakeAddresses\Model\Table\SubregionsTable;
|
||||
/**
|
||||
* CakeAddresses\Model\Table\SubregionsTable Test Case
|
||||
*/
|
||||
class SubregionsTableTest extends TestCase
|
||||
{
|
||||
/**
|
||||
class SubregionsTableTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Test subject
|
||||
*
|
||||
* @var \CakeAddresses\Model\Table\SubregionsTable
|
||||
*/
|
||||
protected $Subregions;
|
||||
protected $Subregions;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Fixtures
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
];
|
||||
protected array $fixtures = [
|
||||
'plugin.CakeAddresses.Subregions',
|
||||
'plugin.CakeAddresses.Regions',
|
||||
'plugin.CakeAddresses.Countries',
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* setUp method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Subregions') ? [] : ['className' => SubregionsTable::class];
|
||||
$this->Subregions = $this->getTableLocator()->get('Subregions', $config);
|
||||
}
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$config = $this->getTableLocator()->exists('Subregions') ? [] : ['className' => SubregionsTable::class];
|
||||
$this->Subregions = $this->getTableLocator()->get('Subregions', $config);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* tearDown method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function tearDown(): void
|
||||
{
|
||||
unset($this->Subregions);
|
||||
protected function tearDown(): void {
|
||||
unset($this->Subregions);
|
||||
|
||||
parent::tearDown();
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test validationDefault method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\SubregionsTable::validationDefault()
|
||||
* @return void
|
||||
*/
|
||||
public function testValidationDefault(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testValidationDefault(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test buildRules method
|
||||
*
|
||||
* @return void
|
||||
* @uses \CakeAddresses\Model\Table\SubregionsTable::buildRules()
|
||||
* @return void
|
||||
*/
|
||||
public function testBuildRules(): void
|
||||
{
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
public function testBuildRules(): void {
|
||||
$this->markTestIncomplete('Not implemented yet.');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,20 +7,19 @@ use Cake\Core\Configure;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Connection;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\TestSuite\Fixture\SchemaLoader;
|
||||
use CakeAddresses\CakeAddressesPlugin;
|
||||
use Migrations\TestSuite\Migrator;
|
||||
use TestApp\Controller\AppController;
|
||||
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
if (!defined('WINDOWS')) {
|
||||
if (DS === '\\' || substr(PHP_OS, 0, 3) === 'WIN') {
|
||||
define('WINDOWS', true);
|
||||
} else {
|
||||
define('WINDOWS', false);
|
||||
}
|
||||
if (DS === '\\' || substr(PHP_OS, 0, 3) === 'WIN') {
|
||||
define('WINDOWS', true);
|
||||
} else {
|
||||
define('WINDOWS', false);
|
||||
}
|
||||
}
|
||||
|
||||
define('PLUGIN_ROOT', dirname(__DIR__));
|
||||
@@ -45,39 +44,39 @@ require CORE_PATH . 'config/bootstrap.php';
|
||||
require CAKE . 'functions.php';
|
||||
|
||||
Configure::write('App', [
|
||||
'namespace' => 'TestApp',
|
||||
'encoding' => 'UTF-8',
|
||||
'paths' => [
|
||||
'testWebroot' => PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS,
|
||||
'webroot' => PLUGIN_ROOT . DS . 'webroot' . DS,
|
||||
'templates' => [
|
||||
PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS,
|
||||
],
|
||||
],
|
||||
'namespace' => 'TestApp',
|
||||
'encoding' => 'UTF-8',
|
||||
'paths' => [
|
||||
'testWebroot' => PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS,
|
||||
'webroot' => PLUGIN_ROOT . DS . 'webroot' . DS,
|
||||
'templates' => [
|
||||
PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
Configure::write('debug', true);
|
||||
Configure::write('CakeAddresses', []);
|
||||
|
||||
$cache = [
|
||||
'default' => [
|
||||
'engine' => 'File',
|
||||
'path' => CACHE,
|
||||
],
|
||||
'_cake_translations_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_my_app_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => 'File',
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'default' => [
|
||||
'engine' => 'File',
|
||||
'path' => CACHE,
|
||||
],
|
||||
'_cake_translations_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_my_app_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => 'File',
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
];
|
||||
|
||||
Cache::setConfig($cache);
|
||||
@@ -89,15 +88,15 @@ Plugin::getCollection()->add(new CakeAddressesPlugin());
|
||||
Chronos::setTestNow(Chronos::now());
|
||||
|
||||
if (!getenv('DB_URL')) {
|
||||
putenv('DB_URL=sqlite:///:memory:');
|
||||
putenv('DB_URL=sqlite:///:memory:');
|
||||
}
|
||||
|
||||
ConnectionManager::setConfig('test', [
|
||||
'className' => Connection::class,
|
||||
'url' => getenv('DB_URL') ?: null,
|
||||
'timezone' => 'UTC',
|
||||
'quoteIdentifiers' => false,
|
||||
'cacheMetadata' => true,
|
||||
'className' => Connection::class,
|
||||
'url' => getenv('DB_URL') ?: null,
|
||||
'timezone' => 'UTC',
|
||||
'quoteIdentifiers' => false,
|
||||
'cacheMetadata' => true,
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Based entirely off of dereuromark's plugins as I was having trouble getting fixtures to load
|
||||
* after moving the plugins outside of an existing cakephp app's plugins folder
|
||||
|
||||
Reference in New Issue
Block a user