/** * ResetBehaviorTest::testResetWithCallbackAndFieldsAutoAdded() * * @return void */ public function testResetWithCallbackAndFieldsAutoAdded() { $this->Table->removeBehavior('Reset'); $this->Table->addBehavior('Tools.Reset', ['fields' => ['id'], 'updateFields' => ['id'], 'callback' => 'TestApp\\Model\\Table\\ResetCommentsTable::fieldsCallbackAuto']); $x = $this->Table->find('first', ['conditions' => ['id' => 6]]); $this->assertEquals('Second Comment for Second Article', $x['comment']); $result = $this->Table->resetRecords(); $this->assertTrue((bool) $result); $x = $this->Table->find('first', ['conditions' => ['id' => 6]]); $expected = 'bar'; $this->assertEquals($expected, $x['comment']); }