silverstripe-cms/tests/controller/CMSMainTest_ClassB.php
Damian Mooyman c2c75aa9e3
Fix and upgrade all tests
Fix link tracking
2017-06-21 16:29:40 +12:00

17 lines
369 B
PHP

<?php
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\ValidationException;
class CMSMainTest_ClassB extends Page implements TestOnly
{
protected function onBeforeWrite()
{
parent::onBeforeWrite();
if ($this->ClassName !== self::class) {
throw new ValidationException("Class saved with incorrect ClassName");
}
}
}