Page MenuHomeSealhub

PhobjectTestCase.php
No OneTemporary

Authored By
Unknown
Size
801 B
Referenced Files
None
Subscribers
None

PhobjectTestCase.php

<?php
final class PhobjectTestCase extends PhutilTestCase {
public function testThrowOnUndeclaredProperty() {
$object = new PhutilTestPhobject();
$caught = null;
try {
$object->duck;
} catch (Exception $ex) {
$caught = $ex;
}
$this->assertTrue($caught instanceof DomainException);
$caught = null;
try {
$object->duck = 'quack';
} catch (Exception $ex) {
$caught = $ex;
}
$this->assertTrue($caught instanceof DomainException);
}
public function testThrowOnIteration() {
$object = new PhutilTestPhobject();
$caught = null;
try {
foreach ($object as $item) {
// ...
}
} catch (Exception $ex) {
$caught = $ex;
}
$this->assertTrue($caught instanceof DomainException);
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 27, 18:21 (11 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1229356
Default Alt Text
PhobjectTestCase.php (801 B)

Event Timeline