'kj', 'level' => 3]); $this->assertSame('kj', $n->username); $this->assertSame(3, $n->level); } public function testConstructFromObjectCopiesPublicProperties(): void { $source = new \stdClass(); $source->id = 7; $source->email = 'kj@example.com'; $n = new Neuron($source); $this->assertSame(7, $n->id); $this->assertSame('kj@example.com', $n->email); } public function testUndefinedPropertyIsNullWithoutNotice(): void { $n = new Neuron(); $this->assertNull($n->thisDoesNotExist); } public function testDynamicPropertiesCanBeAssignedAndRead(): void { $n = new Neuron(); $n->fresh = ['a', 'b']; $this->assertSame(['a', 'b'], $n->fresh); } public function testNestedValuesArePreservedVerbatim(): void { $payload = ['meta' => ['tags' => ['x', 'y'], 'n' => null]]; $n = new Neuron($payload); $this->assertSame($payload['meta'], $n->meta); $this->assertNull($n->meta['n']); } }