public function testNotations() { $superName = 'blog-slug-3'; $colName = 'title'; $value = 'Another blog by me'; // --------- Array Access // // Test Super add $this->obj[$superName] = new TestSuperColumn($superName); $this->assertTrue($this->obj[$superName] instanceof PandraSuperColumn); // Check column name and not column name are correctly set $this->obj->reset(); $this->assertFalse($this->obj->isModified()); $this->obj[$superName][$colName] = $value; $this->assertTrue($this->obj->isModified()); $this->assertTrue($this->obj[$superName][$colName] == $value); $this->assertFalse($this->obj[$superName]['NOT_' . $colName] == $value); // Unset unset($this->obj[$superName][$colName]); $this->assertTrue($this->obj[$superName][$colName] == NULL); unset($this->obj[$superName]); $this->assertTrue($this->obj[$superName] == NULL); // --------- Magic Methods // Test Super Add $superPath = PandraSuperColumnFamily::_columnNamePrefix . $superName; $columnPath = PandraColumnFamily::_columnNamePrefix . $colName; $this->obj->{$superPath} = new TestSuperColumn($superName); $this->assertTrue($this->obj->{$superPath} instanceof PandraSuperColumn); // Check column name and not column name are correctly set $this->obj->reset(); $this->assertFalse($this->obj->isModified()); $this->obj->{$superPath}->{$columnPath} = $value; $this->assertTrue($this->obj->isModified()); $this->assertTrue($this->obj->{$superPath}->{$columnPath} == $value); $nColumnPath = 'NOT_' . $columnPath; $this->assertFalse($this->obj->{$superPath}->{$nColumnPath} == $value); // Unset //unset($this->obj[$superName][$colName]); $this->obj->{$superPath}->destroyColumn($colName); $this->assertTrue($this->obj->{$superPath}->{$columnPath} == NULL); $this->obj->destroyColumn($superName); $this->assertTrue($this->obj->{$superPath} == NULL); // --------- Accessors/Mutators // Test Super Add $superPath = PandraSuperColumnFamily::_columnNamePrefix . $superName; $columnPath = PandraColumnFamily::_columnNamePrefix . $colName; $this->obj->addSuper(new TestSuperColumn($superName)); $this->assertTrue($this->obj->getSuper($superName) instanceof PandraSuperColumn); // Check column name and not column name are correctly set $this->obj->reset(); $this->assertFalse($this->obj->isModified()); $this->obj->getSuper($superName)->getColumn($colName)->setValue($value); $this->assertTrue($this->obj->isModified()); $this->assertTrue($this->obj->getSuper($superName)->getColumn($colName)->value == $value); $this->assertFalse($this->obj->getSuper($superName)->getColumn('NOT_' . $colName)->value == $value); // Unset unset($this->obj[$superName][$colName]); $this->obj->getSuper($superName)->destroyColumn($colName); $this->assertTrue($this->obj->getSuper($superName)->getColumn($colName) == NULL); unset($this->obj[$superName]); $this->obj->destroyColumn($superName); $this->assertTrue($this->obj->getSuper($superName) == NULL); }