Add core classes and tests for Groq AI compatibility, logging, and model services
- Implement Groq_AI_Compatibility_Service to manage WooCommerce dependency and admin notices. - Create Groq_AI_Log_Scheduler for scheduled log cleanup based on settings. - Develop Groq_AI_Model_Service for model selection and caching. - Add language translations in POT file for Dutch. - Set up PHPUnit configuration and bootstrap for testing. - Implement unit tests for model exclusions, provider request building, settings management, and term saving functionality.
This commit is contained in:
17
tests/ModelExclusionsTest.php
Normal file
17
tests/ModelExclusionsTest.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class ModelExclusionsTest extends TestCase {
|
||||
public function test_ensure_allowed_blocks_excluded_model() {
|
||||
$blocked = Groq_AI_Model_Exclusions::ensure_allowed( 'groq', 'whisper-large-v3' );
|
||||
$this->assertSame( '', $blocked );
|
||||
}
|
||||
|
||||
public function test_filter_models_removes_excluded_entries() {
|
||||
$models = [ 'llama3-70b-8192', 'whisper-large-v3', 'mixtral-8x7b-32768' ];
|
||||
$filtered = Groq_AI_Model_Exclusions::filter_models( 'groq', $models );
|
||||
|
||||
$this->assertSame( [ 'llama3-70b-8192', 'mixtral-8x7b-32768' ], $filtered );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user