/** * @dataProvider provideChangedData */ public function testIsDataChanged($oldData, $newData) { $invoker = new \stdClass(); $mutableEventArgs = new MutableEventArgs($invoker, $oldData); $this->assertFalse($mutableEventArgs->isDataChanged()); $this->assertSame($oldData, $mutableEventArgs->getData()); $mutableEventArgs->setData($oldData); $this->assertSame($oldData, $mutableEventArgs->getData()); $this->assertFalse($mutableEventArgs->isDataChanged()); $mutableEventArgs->setData($newData); $this->assertSame($newData, $mutableEventArgs->getData()); $this->assertTrue($mutableEventArgs->isDataChanged()); $mutableEventArgs->setData($newData); $this->assertSame($newData, $mutableEventArgs->getData()); $this->assertTrue($mutableEventArgs->isDataChanged()); $mutableEventArgs->setData($oldData); $this->assertSame($oldData, $mutableEventArgs->getData()); $this->assertFalse($mutableEventArgs->isDataChanged()); }
public function collectionPreRemove(MutableEventArgs $args) { $args->setData($this->query); $args->setOptions($this->options); }