/** * Tests init hooks. * * @covers CustomizeSnapshots\Customize_Snapshot_Manager::init() * @covers CustomizeSnapshots\Customize_Snapshot_Manager::read_current_snapshot_uuid() */ public function test_read_current_snapshot_uuid() { $manager = new Customize_Snapshot_Manager($this->plugin); $this->assertFalse($manager->read_current_snapshot_uuid()); $this->assertNull($manager->current_snapshot_uuid); $_REQUEST['customize_snapshot_uuid'] = 'bad'; $this->assertFalse($manager->read_current_snapshot_uuid()); $this->assertNull($manager->current_snapshot_uuid); $_REQUEST['customize_snapshot_uuid'] = self::UUID; $this->assertTrue($manager->read_current_snapshot_uuid()); $this->assertEquals(self::UUID, $manager->current_snapshot_uuid); $_REQUEST['customize_snapshot_uuid'] = self::UUID; $manager = new Customize_Snapshot_Manager($this->plugin); $manager->init(); $this->assertEquals(self::UUID, $manager->current_snapshot_uuid); }