45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Tests\Feature\Business;
|
|
|
|
use App\Utilities\BusinessNavigation;
|
|
use Tests\Feature\FeatureTestCase;
|
|
|
|
class ProcessDetailsNavigationTest extends FeatureTestCase
|
|
{
|
|
public function test_oa_process_is_in_dedicated_process_data_section(): void
|
|
{
|
|
$navigation = BusinessNavigation::all();
|
|
$slugs = array_column($navigation, 'slug');
|
|
|
|
$inventoryIndex = array_search('inventory-management', $slugs, true);
|
|
$processDataIndex = array_search('process-data', $slugs, true);
|
|
$financeIndex = array_search('financial-operations', $slugs, true);
|
|
|
|
$this->assertIsInt($inventoryIndex);
|
|
$this->assertIsInt($processDataIndex);
|
|
$this->assertIsInt($financeIndex);
|
|
$this->assertSame($inventoryIndex + 1, $processDataIndex);
|
|
$this->assertSame($processDataIndex + 1, $financeIndex);
|
|
|
|
$section = $navigation[$processDataIndex];
|
|
$this->assertSame('流程数据', $section['title']);
|
|
$this->assertSame(
|
|
[['slug' => 'oa-process', 'title' => 'OA流程']],
|
|
array_map(
|
|
static fn (array $page): array => [
|
|
'slug' => $page['slug'],
|
|
'title' => $page['title'],
|
|
],
|
|
$section['pages'],
|
|
),
|
|
);
|
|
|
|
$finance = $navigation[$financeIndex];
|
|
$this->assertNotContains(
|
|
'process-details',
|
|
array_column($finance['pages'] ?? [], 'slug'),
|
|
);
|
|
}
|
|
}
|