expectException(\Exception::class); $this->expectExceptionMessage("Invalid value '' for 'scope' specified. Available scopes are: visit, action, conversion"); $this->buildScope('')->check(); } public function testCheckShouldFailWhenScopeIsNotValid() { $this->expectException(\Exception::class); $this->expectExceptionMessage("Invalid value 'anyScoPe' for 'scope' specified. Available scopes are: visit, action, conversion"); $this->buildScope('anyScoPe')->check(); } public function testCheckShouldNotFailWhenScopeIsValid() { self::expectNotToPerformAssertions(); $this->buildScope('action')->check(); $this->buildScope('visit')->check(); $this->buildScope('conversion')->check(); } private function buildScope($scope) { return new Scope($scope); } }