Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Commit

Permalink
Adjust test code after xp-framework/rfc#297 was implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jan 24, 2016
1 parent 925afd6 commit 1c8659a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ XP Compiler ChangeLog

## ?.?.? / ????-??-??

* Adjusted test code after xp-framework/rfc#297 was implemented
(@thekid)

## 6.0.0 / 2016-01-23

* **Adopted semantic versioning. See xp-framework/rfc#300** - @thekid
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/xp/compiler/Syntax.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function parse(InputStream $in, $source= null, $messages= null) {
$this->parser= $this->newParser();
}

$result= $this->parser->parse($this->newLexer($in, $source ? $source : $in->toString()));
$result= $this->parser->parse($this->newLexer($in, $source ? $source : \xp::stringOf($in)));
if ($messages) foreach ($this->parser->getWarnings() as $warning) {
$messages->warn(
sprintf('P%03d', $warning->code),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function nullAsVarArray() {
}

#[@test]
public function dateAsObject() {
$this->run('return new util.Date() as lang.Object;');
public function dateAsValue() {
$this->run('return new util.Date() as lang.Value;');
}

#[@test, @expect(ClassCastException::class)]
Expand Down
12 changes: 6 additions & 6 deletions src/test/php/net/xp_lang/tests/types/ScopeTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ public function mapExtension() {
#[@test]
public function objectExtensionInherited() {
with (
$objectType= new TypeReflection(XPClass::forName('lang.Object')),
$dateType= new TypeReflection(XPClass::forName('util.Date')),
$classNameMethod= new Method('getClassName')
$parentType= new TypeReflection(XPClass::forName('unittest.TestCase')),
$thisType= new TypeReflection(typeof($this)),
$getNameMethod= new Method('getName')
); {
$this->fixture->addExtension($objectType, $classNameMethod);
$this->fixture->addExtension($parentType, $getNameMethod);
$this->assertEquals(
$classNameMethod,
$this->fixture->getExtension($dateType, $classNameMethod->name)
$getNameMethod,
$this->fixture->getExtension($thisType, $getNameMethod->name)
);
}
}
Expand Down

0 comments on commit 1c8659a

Please sign in to comment.