Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/PhutilTypeSpecTestCase.php
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | $map = array( | ||||
new RuntimeException(), | new RuntimeException(), | ||||
), | ), | ||||
'map<string, stdClass>' => array('x' => new stdClass()), | 'map<string, stdClass>' => array('x' => new stdClass()), | ||||
); | ); | ||||
foreach ($map as $expect => $input) { | foreach ($map as $expect => $input) { | ||||
$this->assertEqual( | $this->assertEqual( | ||||
$expect, | $expect, | ||||
PhutilTypeSpec::getTypeOf($input), | PhutilTypeSpec::getTypeOf($input)); | ||||
print_r($input, true)); | |||||
PhutilTypeSpec::newFromString($expect)->check($input); | PhutilTypeSpec::newFromString($expect)->check($input); | ||||
} | } | ||||
} | } | ||||
public function testTypeCheckFailures() { | public function testTypeCheckFailures() { | ||||
$map = array( | $map = array( | ||||
'int' => 'string', | 'int' => 'string', | ||||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |