44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Basic project smoke tests.
|
|
*
|
|
* @package RSS2CPT
|
|
*/
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Verifies project-level invariants without loading WordPress.
|
|
*/
|
|
final class SmokeTest extends TestCase {
|
|
/**
|
|
* Verify the runtime supports the plugin baseline.
|
|
*/
|
|
public function test_supported_php_runtime(): void {
|
|
$this->assertTrue( version_compare( PHP_VERSION, '7.4', '>=' ) );
|
|
}
|
|
|
|
/**
|
|
* Verify the persisted option name remains stable.
|
|
*/
|
|
public function test_option_key_is_stable(): void {
|
|
$this->assertSame( 'rss2cpt_settings', RSS2CPT\Options::KEY );
|
|
}
|
|
|
|
/**
|
|
* Verify backfills use a safe bounded default.
|
|
*/
|
|
public function test_default_import_limit_is_bounded(): void {
|
|
$settings = RSS2CPT\Options::get();
|
|
$this->assertSame( 25, $settings['item_limit'] );
|
|
}
|
|
|
|
/**
|
|
* Verify ongoing imports do not inherit WordPress's long feed cache.
|
|
*/
|
|
public function test_importer_uses_short_feed_cache(): void {
|
|
$importer = new RSS2CPT\Import\Importer();
|
|
$this->assertSame( 300, $importer->filter_feed_cache_lifetime( 43200, 'https://example.test/feed.xml' ) );
|
|
}
|
|
}
|