tome export

This commit is contained in:
Oliver Davies 2025-05-30 02:14:32 +01:00
parent 52278c3a53
commit 7a52afab5f
960 changed files with 3670 additions and 2229 deletions

View file

@ -82,15 +82,15 @@
],
"body": [
{
"value": "\n <p>If you have multiple implementations of a service, as I <a href=\"/daily\/2023\/08\/23\/dont-use-third-party-services-directly\">mentioned in yesterday's email<\/a>, you need to ensure they all provide the same functionality.<\/p>\n\n<p>You need to be able to run the same tests against each implementation and have them pass.<\/p>\n\n<h2 id=\"how-do-you-do-this%3F\">How do you do this?<\/h2>\n\n<p>In PHP, I use a trait that contains the test methods and then have a test class for each implementation that uses the trait and sets up any test data.<\/p>\n\n<p>Then, each test class will run the methods from the contract test trait and ensure they all provide the same behaviour, regardless of how it does so - whether it communicates with an API, uses an SDK, or returns fake values.<\/p>\n\n<p>If one implementation doesn't return the same result as the others, its test will fail.<\/p>\n\n<p>If you add a new implementation, you create a new test class, use the trait and get the tests to pass.<\/p>\n\n ",
"value": "\n <p>If you have multiple implementations of a service, as I <a href=\"\/daily\/2023\/08\/23\/dont-use-third-party-services-directly\">mentioned in yesterday's email<\/a>, you need to ensure they all provide the same functionality.<\/p>\n\n<p>You need to be able to run the same tests against each implementation and have them pass.<\/p>\n\n<h2 id=\"how-do-you-do-this%3F\">How do you do this?<\/h2>\n\n<p>In PHP, I use a trait that contains the test methods and then have a test class for each implementation that uses the trait and sets up any test data.<\/p>\n\n<p>Then, each test class will run the methods from the contract test trait and ensure they all provide the same behaviour, regardless of how it does so - whether it communicates with an API, uses an SDK, or returns fake values.<\/p>\n\n<p>If one implementation doesn't return the same result as the others, its test will fail.<\/p>\n\n<p>If you add a new implementation, you create a new test class, use the trait and get the tests to pass.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>If you have multiple implementations of a service, as I <a href=\"/daily\/2023\/08\/23\/dont-use-third-party-services-directly\">mentioned in yesterday's email<\/a>, you need to ensure they all provide the same functionality.<\/p>\n\n<p>You need to be able to run the same tests against each implementation and have them pass.<\/p>\n\n<h2 id=\"how-do-you-do-this%3F\">How do you do this?<\/h2>\n\n<p>In PHP, I use a trait that contains the test methods and then have a test class for each implementation that uses the trait and sets up any test data.<\/p>\n\n<p>Then, each test class will run the methods from the contract test trait and ensure they all provide the same behaviour, regardless of how it does so - whether it communicates with an API, uses an SDK, or returns fake values.<\/p>\n\n<p>If one implementation doesn't return the same result as the others, its test will fail.<\/p>\n\n<p>If you add a new implementation, you create a new test class, use the trait and get the tests to pass.<\/p>\n\n ",
"processed": "\n <p>If you have multiple implementations of a service, as I <a href=\"http:\/\/default\/daily\/2023\/08\/23\/dont-use-third-party-services-directly\">mentioned in yesterday's email<\/a>, you need to ensure they all provide the same functionality.<\/p>\n\n<p>You need to be able to run the same tests against each implementation and have them pass.<\/p>\n\n<h2 id=\"how-do-you-do-this%3F\">How do you do this?<\/h2>\n\n<p>In PHP, I use a trait that contains the test methods and then have a test class for each implementation that uses the trait and sets up any test data.<\/p>\n\n<p>Then, each test class will run the methods from the contract test trait and ensure they all provide the same behaviour, regardless of how it does so - whether it communicates with an API, uses an SDK, or returns fake values.<\/p>\n\n<p>If one implementation doesn't return the same result as the others, its test will fail.<\/p>\n\n<p>If you add a new implementation, you create a new test class, use the trait and get the tests to pass.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "1970-01-01T00:33:45+00:00",
"imported": "1970-01-01T00:32:50+00:00",
"guid": null,
"hash": "385f47a0206ed77604fb346a64e36688",
"target_type": "feeds_feed",