You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #316 added logic which determines what parts of the espionage report to show based on the espionage level of attacker vs defender. It it desired to add feature tests for this behavior.
What the attacker sees in the espionage report depends on:
Add feature tests to test various usecases. For example:
Sending 1 espionage probe where attacker and defender have the same espionage level = expecting to only see resources.
Sending 10 espionage probes where the attacker and defender have the same espionage level = expecting to see everything.
Sending 8 espionage probe where attacker has espionage level 2 and defender has espionage level 4 = expecting to see fleet and defense, but NOT building and tech.
More?
Technical:
The feature tests can be added to the tests/Feature/FleetDispatch/FleetDispatchEspionageTest.php file. Technically what the test should do:
Send espionage mission to foreign planet by using sendMissionToOtherPlayer(). See existing tests which utilize this method.
The sendMissionToOtherPlayer() method returns the (random) foreign planet it has targeted. Use this to update the foreign planet player's espionage tech levels for the test.
Advance time via Carbon::setTestNow() to simulate time has passed to ensure espionage mission has arrived.
Make a request to any page to update the arrived fleet missions.
Assert that the current player has received the espionage report and check the contents of the espionage report via HTML inspection.
Tip: take a look at testDispatchFleetEspionageReport() which already has the expected technical flow but minus the tech level update and espionage report inspection.
The text was updated successfully, but these errors were encountered:
PR #316 added logic which determines what parts of the espionage report to show based on the espionage level of attacker vs defender. It it desired to add feature tests for this behavior.
What the attacker sees in the espionage report depends on:
The rules to validate are available here: https://ogame.fandom.com/wiki/Espionage.
Todo:
Add feature tests to test various usecases. For example:
Technical:
The feature tests can be added to the
tests/Feature/FleetDispatch/FleetDispatchEspionageTest.php
file. Technically what the test should do:sendMissionToOtherPlayer()
. See existing tests which utilize this method.sendMissionToOtherPlayer()
method returns the (random) foreign planet it has targeted. Use this to update the foreign planet player's espionage tech levels for the test.Carbon::setTestNow()
to simulate time has passed to ensure espionage mission has arrived.Tip: take a look at
testDispatchFleetEspionageReport()
which already has the expected technical flow but minus the tech level update and espionage report inspection.The text was updated successfully, but these errors were encountered: