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

Commit 1c8659a

Browse files
committed
Adjust test code after xp-framework/rfc#297 was implemented
1 parent 925afd6 commit 1c8659a

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ XP Compiler ChangeLog
33

44
## ?.?.? / ????-??-??
55

6+
* Adjusted test code after xp-framework/rfc#297 was implemented
7+
(@thekid)
8+
69
## 6.0.0 / 2016-01-23
710

811
* **Adopted semantic versioning. See xp-framework/rfc#300** - @thekid

src/main/php/xp/compiler/Syntax.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function parse(InputStream $in, $source= null, $messages= null) {
7676
$this->parser= $this->newParser();
7777
}
7878

79-
$result= $this->parser->parse($this->newLexer($in, $source ? $source : $in->toString()));
79+
$result= $this->parser->parse($this->newLexer($in, $source ? $source : \xp::stringOf($in)));
8080
if ($messages) foreach ($this->parser->getWarnings() as $warning) {
8181
$messages->warn(
8282
sprintf('P%03d', $warning->code),

src/test/php/net/xp_lang/tests/execution/source/CastingTest.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function nullAsVarArray() {
7979
}
8080

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

8686
#[@test, @expect(ClassCastException::class)]

src/test/php/net/xp_lang/tests/types/ScopeTest.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ public function mapExtension() {
178178
#[@test]
179179
public function objectExtensionInherited() {
180180
with (
181-
$objectType= new TypeReflection(XPClass::forName('lang.Object')),
182-
$dateType= new TypeReflection(XPClass::forName('util.Date')),
183-
$classNameMethod= new Method('getClassName')
181+
$parentType= new TypeReflection(XPClass::forName('unittest.TestCase')),
182+
$thisType= new TypeReflection(typeof($this)),
183+
$getNameMethod= new Method('getName')
184184
); {
185-
$this->fixture->addExtension($objectType, $classNameMethod);
185+
$this->fixture->addExtension($parentType, $getNameMethod);
186186
$this->assertEquals(
187-
$classNameMethod,
188-
$this->fixture->getExtension($dateType, $classNameMethod->name)
187+
$getNameMethod,
188+
$this->fixture->getExtension($thisType, $getNameMethod->name)
189189
);
190190
}
191191
}

0 commit comments

Comments
 (0)