-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for locale info proposal methods
- Loading branch information
Showing
10 changed files
with
355 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
|
||
it('has a property named "collations"') | ||
->expect($reflected->hasProperty('collations')) | ||
->toBeTrue(); | ||
|
||
it('has a method named "getCollations"') | ||
->expect($reflected->hasMethod('getCollations')) | ||
->toBeTrue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
$property = $reflected->getProperty('collations'); | ||
$type = $property->getType(); | ||
|
||
test('its name is "collations"') | ||
->expect($property->getName()) | ||
->toBe('collations'); | ||
|
||
it('is a public property') | ||
->expect($property->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static property') | ||
->expect($property->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('is a readonly property') | ||
->expect($property->isReadOnly()) | ||
->toBeTrue(); | ||
|
||
it('is an array type and does not allow null values') | ||
->expect($type) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($type->allowsNull()) | ||
->toBeFalse() | ||
->and($type->getName()) | ||
->toBe('array'); | ||
|
||
$method = $reflected->getMethod('getCollations'); | ||
$returnType = $method->getReturnType(); | ||
|
||
test('its name is "getCollations"') | ||
->expect($method->getName()) | ||
->toBe('getCollations'); | ||
|
||
it('is a public method') | ||
->expect($method->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static method') | ||
->expect($method->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('returns an array type and does not return null') | ||
->expect($returnType) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($returnType->allowsNull()) | ||
->toBeFalse() | ||
->and($returnType->getName()) | ||
->toBe('array'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
|
||
it('has a property named "currencies"') | ||
->expect($reflected->hasProperty('currencies')) | ||
->toBeTrue(); | ||
|
||
it('has a method named "getCurrencies"') | ||
->expect($reflected->hasMethod('getCurrencies')) | ||
->toBeTrue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
$property = $reflected->getProperty('currencies'); | ||
$type = $property->getType(); | ||
|
||
test('its name is "currencies"') | ||
->expect($property->getName()) | ||
->toBe('currencies'); | ||
|
||
it('is a public property') | ||
->expect($property->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static property') | ||
->expect($property->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('is a readonly property') | ||
->expect($property->isReadOnly()) | ||
->toBeTrue(); | ||
|
||
it('is an array type and does not allow null values') | ||
->expect($type) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($type->allowsNull()) | ||
->toBeFalse() | ||
->and($type->getName()) | ||
->toBe('array'); | ||
|
||
$method = $reflected->getMethod('getCurrencies'); | ||
$returnType = $method->getReturnType(); | ||
|
||
test('its name is "getCurrencies"') | ||
->expect($method->getName()) | ||
->toBe('getCurrencies'); | ||
|
||
it('is a public method') | ||
->expect($method->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static method') | ||
->expect($method->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('returns an array type and does not return null') | ||
->expect($returnType) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($returnType->allowsNull()) | ||
->toBeFalse() | ||
->and($returnType->getName()) | ||
->toBe('array'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
|
||
it('has a property named "hourCycles"') | ||
->expect($reflected->hasProperty('hourCycles')) | ||
->toBeTrue(); | ||
|
||
it('has a method named "getHourCycles"') | ||
->expect($reflected->hasMethod('getHourCycles')) | ||
->toBeTrue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
$property = $reflected->getProperty('hourCycles'); | ||
$type = $property->getType(); | ||
|
||
test('its name is "hourCycles"') | ||
->expect($property->getName()) | ||
->toBe('hourCycles'); | ||
|
||
it('is a public property') | ||
->expect($property->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static property') | ||
->expect($property->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('is a readonly property') | ||
->expect($property->isReadOnly()) | ||
->toBeTrue(); | ||
|
||
it('is an array type and does not allow null values') | ||
->expect($type) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($type->allowsNull()) | ||
->toBeFalse() | ||
->and($type->getName()) | ||
->toBe('array'); | ||
|
||
$method = $reflected->getMethod('getHourCycles'); | ||
$returnType = $method->getReturnType(); | ||
|
||
test('its name is "getHourCycles"') | ||
->expect($method->getName()) | ||
->toBe('getHourCycles'); | ||
|
||
it('is a public method') | ||
->expect($method->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static method') | ||
->expect($method->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('returns an array type and does not return null') | ||
->expect($returnType) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($returnType->allowsNull()) | ||
->toBeFalse() | ||
->and($returnType->getName()) | ||
->toBe('array'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
|
||
it('has a property named "numberingSystems"') | ||
->expect($reflected->hasProperty('numberingSystems')) | ||
->toBeTrue(); | ||
|
||
it('has a method named "getNumberingSystems"') | ||
->expect($reflected->hasMethod('getNumberingSystems')) | ||
->toBeTrue(); |
56 changes: 56 additions & 0 deletions
56
tests/intl402/Locale/prototype/numberingSystems/prop-desc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
$property = $reflected->getProperty('numberingSystems'); | ||
$type = $property->getType(); | ||
|
||
test('its name is "numberingSystems"') | ||
->expect($property->getName()) | ||
->toBe('numberingSystems'); | ||
|
||
it('is a public property') | ||
->expect($property->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static property') | ||
->expect($property->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('is a readonly property') | ||
->expect($property->isReadOnly()) | ||
->toBeTrue(); | ||
|
||
it('is an array type and does not allow null values') | ||
->expect($type) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($type->allowsNull()) | ||
->toBeFalse() | ||
->and($type->getName()) | ||
->toBe('array'); | ||
|
||
$method = $reflected->getMethod('getNumberingSystems'); | ||
$returnType = $method->getReturnType(); | ||
|
||
test('its name is "getNumberingSystems"') | ||
->expect($method->getName()) | ||
->toBe('getNumberingSystems'); | ||
|
||
it('is a public method') | ||
->expect($method->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static method') | ||
->expect($method->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('returns an array type and does not return null') | ||
->expect($returnType) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($returnType->allowsNull()) | ||
->toBeFalse() | ||
->and($returnType->getName()) | ||
->toBe('array'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
|
||
it('has a property named "timeZones"') | ||
->expect($reflected->hasProperty('timeZones')) | ||
->toBeTrue(); | ||
|
||
it('has a method named "getTimeZones"') | ||
->expect($reflected->hasMethod('getTimeZones')) | ||
->toBeTrue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Ecma\Intl\Locale; | ||
|
||
$reflected = new ReflectionClass(Locale::class); | ||
$property = $reflected->getProperty('timeZones'); | ||
$type = $property->getType(); | ||
|
||
test('its name is "timeZones"') | ||
->expect($property->getName()) | ||
->toBe('timeZones'); | ||
|
||
it('is a public property') | ||
->expect($property->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static property') | ||
->expect($property->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('is a readonly property') | ||
->expect($property->isReadOnly()) | ||
->toBeTrue(); | ||
|
||
it('is an array type and allows null values') | ||
->expect($type) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($type->allowsNull()) | ||
->toBeTrue() | ||
->and($type->getName()) | ||
->toBe('array'); | ||
|
||
$method = $reflected->getMethod('getTimeZones'); | ||
$returnType = $method->getReturnType(); | ||
|
||
test('its name is "getTimeZones"') | ||
->expect($method->getName()) | ||
->toBe('getTimeZones'); | ||
|
||
it('is a public method') | ||
->expect($method->isPublic()) | ||
->toBeTrue(); | ||
|
||
it('is not a static method') | ||
->expect($method->isStatic()) | ||
->toBeFalse(); | ||
|
||
it('returns an array type and can return null') | ||
->expect($returnType) | ||
->toBeInstanceOf(ReflectionType::class) | ||
->and($returnType->allowsNull()) | ||
->toBeTrue() | ||
->and($returnType->getName()) | ||
->toBe('array'); |