public function testBrandToggleVisibility() { $brand = $this->getRandomBrand(); $visibility = $brand->getVisible(); $event = new BrandToggleVisibilityEvent($brand); $event->setDispatcher($this->dispatcher); $brandAction = new Brand($this->getContainer()); $brandAction->toggleVisibility($event); $updatedBrand = $event->getBrand(); $this->assertInstanceOf('Thelia\\Model\\Brand', $updatedBrand); $this->assertEquals(!$visibility, $updatedBrand->getVisible()); }