Well I think a unit test is not the way to go here. A unit test tests the unit itself, however you want to test the database here and see if everything was added correctly.
Assuming you've setup factories in your application you can do something like this
public function testCreatingSettlementWithSyncedResources()
{
$resources = factory(Resource::class, 2)->create();
$this->post('settlement', [
'name' => 'Settlement name',
]);
$this->assertDatabaseHas('settlements', [
'name' => 'Settlement name',
]);
$settlement = Settlement::where('name', 'Settlement name')->first();
foreach($resources as $resource) {
$this->assertDatabaseHas('resource_settlement', [
'resource_id' => $resource->id,
'settlement_id' => $settlement->id,
]);
}
}
Documentation: https://laravel.com/docs/5.6/database-testing#introduction
Also another small note, I wouldn't place the getResourcesIds in the Settlement model. Settlement shouldn't know all the resources, but only its own resources using the relationship. This should either me a helper method, repository or just a private method in your controller. Just my 2 cents ;)
Let me know if I can help you any further ;)