Remove static cache from our_address in favour of Cache::class keyed off setup:system_id

This commit is contained in:
2024-04-26 17:27:00 +10:00
parent 9abfd88e3d
commit 92f964f572
2 changed files with 12 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ namespace Tests\Feature;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\Cache;
use Tests\TestCase;
use App\Models\{Address,Domain,Setup,System};
@@ -268,10 +269,12 @@ class RoutingTest extends TestCase
public function test_complex_rc_nc_hc_us()
{
Cache::forget('so');
$setup = Setup::findOrFail(config('app.id'));
$ao = Address::findFTN('100:10/0.0@a');
$setup->system_id = $ao->system_id;
$setup->save();
$this->assertEquals('100:10/0.0@a',our_address($ao)?->ftn);
$this->session_rc();
//$this->session_nc();
@@ -303,6 +306,7 @@ class RoutingTest extends TestCase
$ao = Address::findFTN('100:10/22.0@a');
$this->assertEquals('100:10/20.0@a',$ao->parent()->ftn);
Cache::forget('so');
}
// A points parent is the node, if we have traffic for a point and we have session details for the node