Loading tests/src/Unit/Plugin/AiFunctionCall/FileToTextAccessTest.php +14 −0 Changes for tests/src/Unit/Plugin/AiFunctionCall/FileToTextAccessTest.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ namespace Drupal\Tests\ai_file_to_text\Unit\Plugin\AiFunctionCall; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\ai\Base\FunctionCallBase; use Drupal\ai_file_to_text\Plugin\AiFunctionCall\FileToText; use Drupal\file\FileInterface; use Drupal\Tests\UnitTestCase; Loading @@ -25,6 +26,19 @@ use PHPUnit\Framework\Attributes\Group; #[Group('ai_file_to_text')] class FileToTextAccessTest extends UnitTestCase { /** * {@inheritdoc} */ protected function setUp(): void { parent::setUp(); // The AiFunctionCall plugins are a soft dependency: drupal/ai is not in // this module's composer requirements, so it is absent from CI and the // plugin's base class cannot be autoloaded there. Skip rather than fatal. if (!class_exists(FunctionCallBase::class)) { $this->markTestSkipped('Requires drupal/ai, which is a soft dependency of this module.'); } } /** * Builds the plugin with mocked dependencies and fixed context values. * Loading Loading
tests/src/Unit/Plugin/AiFunctionCall/FileToTextAccessTest.php +14 −0 Changes for tests/src/Unit/Plugin/AiFunctionCall/FileToTextAccessTest.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ namespace Drupal\Tests\ai_file_to_text\Unit\Plugin\AiFunctionCall; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Session\AccountInterface; use Drupal\ai\Base\FunctionCallBase; use Drupal\ai_file_to_text\Plugin\AiFunctionCall\FileToText; use Drupal\file\FileInterface; use Drupal\Tests\UnitTestCase; Loading @@ -25,6 +26,19 @@ use PHPUnit\Framework\Attributes\Group; #[Group('ai_file_to_text')] class FileToTextAccessTest extends UnitTestCase { /** * {@inheritdoc} */ protected function setUp(): void { parent::setUp(); // The AiFunctionCall plugins are a soft dependency: drupal/ai is not in // this module's composer requirements, so it is absent from CI and the // plugin's base class cannot be autoloaded there. Skip rather than fatal. if (!class_exists(FunctionCallBase::class)) { $this->markTestSkipped('Requires drupal/ai, which is a soft dependency of this module.'); } } /** * Builds the plugin with mocked dependencies and fixed context values. * Loading