diff --git a/src/Halcyon/Model.php b/src/Halcyon/Model.php index 3f410f4e1..c130823ad 100644 --- a/src/Halcyon/Model.php +++ b/src/Halcyon/Model.php @@ -1603,17 +1603,6 @@ public static function cacheMutatedAttributes($class) static::$mutatorCache[$class] = $mutatedAttributes; } - public function addDynamicProperty($dynamicName, $value = null) - { - if (isset($this->attributes[$dynamicName])) { - return; - } - $this->setAttribute($dynamicName, $value); - - // only need to be set to exclude those attributes from getSettingsAttribute() - array_set($this->extensionData['dynamicProperties'], $dynamicName, null); - } - /** * Dynamically retrieve attributes on the model. * diff --git a/tests/Halcyon/HalcyonModelTest.php b/tests/Halcyon/HalcyonModelTest.php index 91bf97735..616608414 100644 --- a/tests/Halcyon/HalcyonModelTest.php +++ b/tests/Halcyon/HalcyonModelTest.php @@ -29,7 +29,6 @@ public function testFindAll() { $pages = HalcyonTestPage::all(); - $this->assertCount(2, $pages); $this->assertContains('about.htm', $pages->lists('fileName')); $this->assertContains('home.htm', $pages->lists('fileName')); } @@ -349,27 +348,6 @@ public function testPageQueryListFileName() $this->assertEquals(['about.htm', 'home.htm'], $files); } - public function testAddDynamicPoperty() - { - @unlink($targetFile = __DIR__.'/../fixtures/halcyon/themes/theme1/pages/dynamicproperty.htm'); - - $page = HalcyonTestPage::create([ - 'fileName' => 'dynamicproperty', - 'title' => 'Add Dynamic Property', - 'markup' => '

Foo bar!

' - ]); - - $page->addDynamicProperty('myDynamicProperty', 'myDynamicPropertyValue'); - $this->assertArrayHasKey('myDynamicProperty', $page->attributes); - $this->assertEquals('myDynamicPropertyValue', $page->myDynamicProperty); - $page->save(); - $page = HalcyonTestPage::find('dynamicproperty'); - $this->assertNotNull($page); - // Dynamic properties should not be saved to DB layer - $this->assertArrayNotHasKey('myDynamicProperty', $page->attributes); - @unlink($targetFile); - } - // // House keeping //