public function testShouldThrowBadMethodCallExceptionWhenCallingInvalidMethod() { $entity = new class extends ActiveRecord { protected $collection = 'collection_name'; }; $this->expectException(BadMethodCallException::class); $entity->foobar(); }