Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions demo/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
bootstrap="tests/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true">
Expand Down
3 changes: 0 additions & 3 deletions demo/tests/Blog/ChatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
namespace App\Tests\Blog;

use App\Blog\Chat;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\MockAgent;
use Symfony\AI\Platform\Message\AssistantMessage;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Message\SystemMessage;
use Symfony\AI\Platform\Message\UserMessage;
Expand All @@ -25,7 +23,6 @@
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;

#[CoversClass(Chat::class)]
final class ChatTest extends TestCase
{
public function testLoadMessagesReturnsDefaultSystemMessage()
Expand Down
2 changes: 0 additions & 2 deletions demo/tests/Blog/PostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
namespace App\Tests\Blog;

use App\Blog\Post;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\Uuid;

#[CoversClass(Post::class)]
final class PostTest extends TestCase
{
public function testPostToString()
Expand Down
2 changes: 0 additions & 2 deletions src/agent/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
failOnRisky="true"
failOnWarning="true">
Expand Down
12 changes: 0 additions & 12 deletions src/agent/tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace Symfony\AI\Agent\Tests;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Psr\Log\LoggerInterface;
use Symfony\AI\Agent\Agent;
Expand Down Expand Up @@ -41,15 +38,6 @@
use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use Symfony\Contracts\HttpClient\ResponseInterface as HttpResponseInterface;

#[CoversClass(Agent::class)]
#[UsesClass(Input::class)]
#[UsesClass(Output::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(UserMessage::class)]
#[UsesClass(Text::class)]
#[UsesClass(Audio::class)]
#[UsesClass(Image::class)]
#[Small]
final class AgentTest extends TestCase
{
public function testConstructorInitializesWithDefaults()
Expand Down
8 changes: 0 additions & 8 deletions src/agent/tests/ChatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace Symfony\AI\Agent\Tests;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\AgentInterface;
Expand All @@ -24,11 +21,6 @@
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Result\TextResult;

#[CoversClass(Chat::class)]
#[UsesClass(Message::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(TextResult::class)]
#[Small]
final class ChatTest extends TestCase
{
private AgentInterface&MockObject $agent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,15 @@

namespace Symfony\AI\Agent\Tests\InputProcessor;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Exception\InvalidArgumentException;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\InputProcessor\ModelOverrideInputProcessor;
use Symfony\AI\Platform\Bridge\Anthropic\Claude;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Model;

#[CoversClass(ModelOverrideInputProcessor::class)]
#[UsesClass(Gpt::class)]
#[UsesClass(Claude::class)]
#[UsesClass(Input::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(Embeddings::class)]
#[Small]
final class ModelOverrideInputProcessorTest extends TestCase
{
public function testProcessInputWithValidModelOption()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@

namespace Symfony\AI\Agent\Tests\InputProcessor;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\InputProcessor\SystemPromptInputProcessor;
use Symfony\AI\Agent\Toolbox\ToolboxInterface;
use Symfony\AI\Fixtures\Tool\ToolNoParams;
use Symfony\AI\Fixtures\Tool\ToolRequiredParams;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Message\Content\Text;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Message\SystemMessage;
Expand All @@ -31,17 +27,6 @@
use Symfony\AI\Platform\Tool\Tool;
use Symfony\Contracts\Translation\TranslatorInterface;

#[CoversClass(SystemPromptInputProcessor::class)]
#[UsesClass(Gpt::class)]
#[UsesClass(Message::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(Input::class)]
#[UsesClass(SystemMessage::class)]
#[UsesClass(UserMessage::class)]
#[UsesClass(Text::class)]
#[UsesClass(Tool::class)]
#[UsesClass(ExecutionReference::class)]
#[Small]
final class SystemPromptInputProcessorTest extends TestCase
{
public function testProcessInputAddsSystemMessageWhenNoneExists()
Expand Down
13 changes: 0 additions & 13 deletions src/agent/tests/Memory/EmbeddingProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace Symfony\AI\Agent\Tests\Memory;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\Memory\EmbeddingProvider;
Expand All @@ -29,16 +26,6 @@
use Symfony\AI\Platform\Vector\Vector;
use Symfony\AI\Store\StoreInterface;

#[UsesClass(Text::class)]
#[UsesClass(ImageUrl::class)]
#[UsesClass(Message::class)]
#[UsesClass(Input::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(StoreInterface::class)]
#[UsesClass(Model::class)]
#[UsesClass(PlatformInterface::class)]
#[CoversClass(EmbeddingProvider::class)]
#[Small]
final class EmbeddingProviderTest extends TestCase
{
public function testItIsDoingNothingWithEmptyMessageBag()
Expand Down
11 changes: 0 additions & 11 deletions src/agent/tests/Memory/MemoryInputProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace Symfony\AI\Agent\Tests\Memory;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\Memory\Memory;
Expand All @@ -23,14 +20,6 @@
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Model;

#[CoversClass(MemoryInputProcessor::class)]
#[UsesClass(MemoryProviderInterface::class)]
#[UsesClass(Input::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(Model::class)]
#[UsesClass(Memory::class)]
#[UsesClass(Message::class)]
#[Small]
final class MemoryInputProcessorTest extends TestCase
{
public function testItIsDoingNothingOnInactiveMemory()
Expand Down
9 changes: 0 additions & 9 deletions src/agent/tests/Memory/StaticMemoryProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,13 @@

namespace Symfony\AI\Agent\Tests\Memory;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Input;
use Symfony\AI\Agent\Memory\Memory;
use Symfony\AI\Agent\Memory\StaticMemoryProvider;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Model;

#[CoversClass(StaticMemoryProvider::class)]
#[UsesClass(Input::class)]
#[UsesClass(Memory::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(Model::class)]
#[Small]
final class StaticMemoryProviderTest extends TestCase
{
public function testItsReturnsNullWhenNoFactsAreProvided()
Expand Down
4 changes: 0 additions & 4 deletions src/agent/tests/MockAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@

namespace Symfony\AI\Agent\Tests;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\MockAgent;
use Symfony\AI\Agent\MockResponse;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Platform\Result\TextResult;

#[CoversClass(MockAgent::class)]
#[Small]
final class MockAgentTest extends TestCase
{
public function testConstructorWithDefaultValues()
Expand Down
4 changes: 0 additions & 4 deletions src/agent/tests/MockResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@

namespace Symfony\AI\Agent\Tests;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\MockResponse;
use Symfony\AI\Platform\Result\TextResult;

#[CoversClass(MockResponse::class)]
#[Small]
final class MockResponseTest extends TestCase
{
public function testConstructorWithContent()
Expand Down
10 changes: 0 additions & 10 deletions src/agent/tests/StructuredOutput/AgentProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

namespace Symfony\AI\Agent\Tests\StructuredOutput;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Exception\MissingModelSupportException;
use Symfony\AI\Agent\Input;
Expand All @@ -36,14 +34,6 @@
use Symfony\AI\Platform\Result\TextResult;
use Symfony\Component\Serializer\SerializerInterface;

#[CoversClass(AgentProcessor::class)]
#[UsesClass(Input::class)]
#[UsesClass(Output::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(MissingModelSupportException::class)]
#[UsesClass(TextResult::class)]
#[UsesClass(ObjectResult::class)]
#[UsesClass(Model::class)]
final class AgentProcessorTest extends TestCase
{
public function testProcessInputWithOutputStructure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@

namespace Symfony\AI\Agent\Tests\StructuredOutput;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\StructuredOutput\ResponseFormatFactory;
use Symfony\AI\Fixtures\StructuredOutput\User;
use Symfony\AI\Platform\Contract\JsonSchema\DescriptionParser;
use Symfony\AI\Platform\Contract\JsonSchema\Factory;

#[CoversClass(ResponseFormatFactory::class)]
#[UsesClass(DescriptionParser::class)]
#[UsesClass(Factory::class)]
final class ResponseFormatFactoryTest extends TestCase
{
public function testCreate()
Expand Down
12 changes: 0 additions & 12 deletions src/agent/tests/Toolbox/AgentProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\AI\Agent\Tests\Toolbox;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\AgentInterface;
use Symfony\AI\Agent\Exception\MissingModelSupportException;
Expand All @@ -30,16 +28,6 @@
use Symfony\AI\Platform\Tool\ExecutionReference;
use Symfony\AI\Platform\Tool\Tool;

#[CoversClass(AgentProcessor::class)]
#[UsesClass(Input::class)]
#[UsesClass(Output::class)]
#[UsesClass(Tool::class)]
#[UsesClass(ToolCall::class)]
#[UsesClass(ToolCallResult::class)]
#[UsesClass(ExecutionReference::class)]
#[UsesClass(MessageBag::class)]
#[UsesClass(MissingModelSupportException::class)]
#[UsesClass(Model::class)]
class AgentProcessorTest extends TestCase
{
public function testProcessInputWithoutRegisteredToolsWillResultInNoOptionChange()
Expand Down
2 changes: 0 additions & 2 deletions src/agent/tests/Toolbox/Attribute/AsToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

namespace Symfony\AI\Agent\Tests\Toolbox\Attribute;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Toolbox\Attribute\AsTool;

#[CoversClass(AsTool::class)]
final class AsToolTest extends TestCase
{
public function testCanBeConstructed()
Expand Down
8 changes: 0 additions & 8 deletions src/agent/tests/Toolbox/FaultTolerantToolboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\AI\Agent\Tests\Toolbox;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Toolbox\Exception\ToolExecutionException;
use Symfony\AI\Agent\Toolbox\Exception\ToolExecutionExceptionInterface;
Expand All @@ -25,12 +23,6 @@
use Symfony\AI\Platform\Tool\ExecutionReference;
use Symfony\AI\Platform\Tool\Tool;

#[CoversClass(FaultTolerantToolbox::class)]
#[UsesClass(ToolCall::class)]
#[UsesClass(Tool::class)]
#[UsesClass(ExecutionReference::class)]
#[UsesClass(ToolNotFoundException::class)]
#[UsesClass(ToolExecutionException::class)]
final class FaultTolerantToolboxTest extends TestCase
{
public function testFaultyToolExecution()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

namespace Symfony\AI\Agent\Tests\Toolbox\MetadataFactory;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\Toolbox\Exception\ToolConfigurationException;
use Symfony\AI\Agent\Toolbox\Exception\ToolException;
Expand All @@ -26,11 +23,6 @@
use Symfony\AI\Fixtures\Tool\ToolOptionalParam;
use Symfony\AI\Fixtures\Tool\ToolRequiredParams;

#[CoversClass(ChainFactory::class)]
#[Medium]
#[UsesClass(MemoryToolFactory::class)]
#[UsesClass(ReflectionToolFactory::class)]
#[UsesClass(ToolException::class)]
final class ChainFactoryTest extends TestCase
{
private ChainFactory $factory;
Expand Down
Loading