Changeset View
Changeset View
Standalone View
Standalone View
src/object/__tests__/PhobjectTestCase.php
- This file was moved from src/object/__tests__/PhutilPhobjectTestCase.php.
| <?php | <?php | ||||
| final class PhutilPhobjectTestCase extends PhutilTestCase { | final class PhobjectTestCase extends PhutilTestCase { | ||||
| public function testThrowOnUndeclaredProperty() { | public function testThrowOnUndeclaredProperty() { | ||||
| $object = new PhutilTestPhobject(); | $object = new PhutilTestPhobject(); | ||||
| $caught = null; | $caught = null; | ||||
| try { | try { | ||||
| $object->duck = 'quack'; | $object->duck; | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $caught = $ex; | $caught = $ex; | ||||
| } | } | ||||
| $this->assertTrue($caught instanceof DomainException); | |||||
| $caught = null; | |||||
| try { | |||||
| $object->duck = 'quack'; | |||||
| } catch (Exception $ex) { | |||||
| $caught = $ex; | |||||
| } | |||||
| $this->assertTrue($caught instanceof DomainException); | $this->assertTrue($caught instanceof DomainException); | ||||
| } | } | ||||
| public function testThrowOnIteration() { | public function testThrowOnIteration() { | ||||
| $object = new PhutilTestPhobject(); | $object = new PhutilTestPhobject(); | ||||
| $caught = null; | $caught = null; | ||||
| try { | try { | ||||
| Show All 11 Lines | |||||