diff --git a/diffs/carbon-date.diff b/diffs/carbon-date.diff index 652f412..e216722 100644 --- a/diffs/carbon-date.diff +++ b/diffs/carbon-date.diff @@ -1,11 +1,11 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 +--- Before 2022-01-24 09:44:04.000000000 -0500 ++++ After 2022-01-24 09:44:04.000000000 -0500 @@ -1,23 +1,12 @@ Carbon\Carbon @1642553042 { + date: 2022-01-18 19:44:02.572622 America/New_York (-05:00) #endOfTime: false #startOfTime: false - #constructedObjectId: "000000002366a380000000002f03d026" + #constructedObjectId: "00000000186315cd0000000058605208" - #localMonthsOverflow: null - #localYearsOverflow: null - #localStrictModeEnabled: null @@ -24,5 +24,5 @@ - #dumpLocale: null - #dumpDateProperties: null - date: 2022-01-18 19:44:02.572622 America/New_York (-05:00) -+ …23 ++ …12 } diff --git a/diffs/container-nested.diff b/diffs/container-nested.diff index 5f3cdf9..251c1d1 100644 --- a/diffs/container-nested.diff +++ b/diffs/container-nested.diff @@ -1,5 +1,5 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 +--- Before 2022-01-24 09:44:04.000000000 -0500 ++++ After 2022-01-24 09:44:04.000000000 -0500 @@ -1,23 +1,3 @@ array:1 [ - 0 => Illuminate\Container\Container { diff --git a/diffs/container.diff b/diffs/container.diff index 0293b0b..6378a15 100644 --- a/diffs/container.diff +++ b/diffs/container.diff @@ -1,5 +1,5 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 +--- Before 2022-01-24 09:44:04.000000000 -0500 ++++ After 2022-01-24 09:44:04.000000000 -0500 @@ -1,7 +1,4 @@ Illuminate\Container\Container { - #resolved: array:1 [ diff --git a/diffs/custom-caster-2.diff b/diffs/custom-caster-2.diff new file mode 100644 index 0000000..9793c26 --- /dev/null +++ b/diffs/custom-caster-2.diff @@ -0,0 +1,7 @@ +--- Before 2022-01-24 09:44:05.000000000 -0500 ++++ After 2022-01-24 09:44:05.000000000 -0500 +@@ -1,3 +1,3 @@ + Glhd\LaravelDumper\Tests\MyOtherCustomObject { +- #bar: "bar" ++ foo: "bar" + } diff --git a/diffs/custom-caster.diff b/diffs/custom-caster.diff new file mode 100644 index 0000000..90d7dda --- /dev/null +++ b/diffs/custom-caster.diff @@ -0,0 +1,12 @@ +--- Before 2022-01-24 09:44:05.000000000 -0500 ++++ After 2022-01-24 09:44:05.000000000 -0500 +@@ -1,6 +1,6 @@ + Glhd\LaravelDumper\Tests\MyCustomObject { ++ +"dyn": "this is a dynamic prop" + #foo: "foo" +- #bar: "bar" +- #nothing: null +- #nah: [] ++ virt: "this is a virtual prop" ++ …1 + } diff --git a/diffs/eloquent-builder.diff b/diffs/eloquent-builder.diff index e37dd43..3460f27 100644 --- a/diffs/eloquent-builder.diff +++ b/diffs/eloquent-builder.diff @@ -1,6 +1,6 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 -@@ -1,11259 +1,12 @@ +--- Before 2022-01-24 09:44:05.000000000 -0500 ++++ After 2022-01-24 09:44:05.000000000 -0500 +@@ -1,11318 +1,12 @@ Illuminate\Database\Eloquent\Builder { - #query: Illuminate\Database\Query\Builder { - +connection: Illuminate\Database\SQLiteConnection { @@ -211,7 +211,6 @@ - 7 => "Glhd\LaravelDumper\Casters\HeaderBagCaster" - 8 => "Glhd\LaravelDumper\Casters\ResponseCaster" - ] -- #base_dir: "/Users/inxilpro/Development/open-source/laravel-dumper" - #app: Illuminate\Foundation\Application {#5} - #bootingCallbacks: [] - #bootedCallbacks: [] @@ -439,7 +438,7 @@ - 0 => "/" - 1 => "\" - ] -- #resolved: array:116 [ +- #resolved: array:119 [ - "Illuminate\Foundation\PackageManifest" => true - "Orchestra\Testbench\Bootstrap\LoadConfiguration" => true - "Illuminate\Foundation\Bootstrap\LoadConfiguration" => true @@ -556,6 +555,9 @@ - "Illuminate\Console\OutputStyle" => true - "db.transactions" => true - "Illuminate\Database\Schema\Blueprint" => true +- "Glhd\LaravelDumper\Casters\BuilderCaster" => true +- "Glhd\LaravelDumper\Casters\ModelCaster" => true +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => true - ] - #bindings: array:172 [ - "Illuminate\Foundation\Mix" => array:2 [ @@ -2206,7 +2208,7 @@ - ] - ] - #methodBindings: [] -- #instances: array:119 [ +- #instances: array:122 [ - "path" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/app" - "path.base" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel" - "path.lang" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/resources/lang" @@ -2220,6 +2222,8 @@ - "Illuminate\Container\Container" => Illuminate\Foundation\Application {#5} - "Illuminate\Foundation\PackageManifest" => Orchestra\Testbench\Foundation\PackageManifest { - #testbench: Glhd\LaravelDumper\Tests\DatabaseCasterTest {#35 +- #write_diff_if_configured: true +- #diff_count: 0 - #baseUrl: "http://localhost" - #backupGlobals: null - #backupGlobalsExcludeList: [] @@ -2256,11 +2260,15 @@ - -statusMessage: "" - -numAssertions: 0 - -result: PHPUnit\Framework\TestResult { -- -passed: array:7 [ +- -passed: array:10 [ - "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => array:2 [ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\CasterTest::test_container" => array:2 [ - "result" => null - "size" => -1 @@ -2277,6 +2285,14 @@ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => array:2 [ +- "result" => null +- "size" => -1 +- ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => array:2 [ - "result" => null - "size" => -1 @@ -2286,8 +2302,9 @@ - "size" => -1 - ] - ] -- -passedTestClasses: array:1 [ +- -passedTestClasses: array:2 [ - 0 => "Glhd\LaravelDumper\Tests\CasterTest" +- 1 => "Glhd\LaravelDumper\Tests\CustomCasterTest" - ] - -currentTestSuiteFailed: false - -errors: [] @@ -2302,7 +2319,7 @@ - 0 => PHPUnit\Runner\ResultCacheExtension { - -cache: PHPUnit\Runner\DefaultTestResultCache { - -cacheFilename: "/Users/inxilpro/Development/open-source/laravel-dumper/.phpunit.result.cache" -- -defects: array:16 [ +- -defects: array:27 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 3 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 3 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 3 @@ -2319,8 +2336,19 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 4 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 3 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 4 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 4 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 3 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 3 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 4 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 3 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 3 - ] -- -times: array:25 [ +- -times: array:43 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 0.103 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 0.06 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 0.146 @@ -2337,15 +2365,33 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 0.024 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 0.138 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 0.025 -- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.067 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.023 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.021 -- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.024 -- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.023 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.109 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.288 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.039 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.042 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.07 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.024 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.022 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.026 +- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.024 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.115 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.297 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.307 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.302 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 0.056 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 0.055 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 0.057 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_reordering_parameters" => 0.013 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_only_keeping_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_excluding_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 0.031 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_loads_helper_functions" => 0.058 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 0.059 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 0.102 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_get_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_and_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_default_filtering" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => 0.013 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 0.042 - ] - } - } @@ -2353,13 +2399,13 @@ - -lastTestWasNotSuccessful: false - } - 1 => PHPUnit\TextUI\DefaultResultPrinter { -- #column: 7 -- #maxColumn: 67 +- #column: 10 +- #maxColumn: 65 - #lastTestFailed: false -- #numAssertions: 7 -- #numTests: 9 -- #numTestsRun: 7 -- #numTestsWidth: 1 +- #numAssertions: 13 +- #numTests: 22 +- #numTestsRun: 10 +- #numTestsWidth: 2 - #colors: true - #debug: false - #verbose: false @@ -2368,15 +2414,15 @@ - -defectListPrinted: false - -timer: SebastianBergmann\Timer\Timer { - -startTimes: array:1 [ -- 0 => 64535660256965.0 +- 0 => 2.7598378317729E+14 - ] - } - -stream: null - -isPhpStream: null - } - ] -- -runTests: 8 -- -time: 0.554184109 +- -runTests: 11 +- -time: 0.721833141 - -codeCoverage: null - -convertDeprecationsToExceptions: false - -convertErrorsToExceptions: true @@ -3063,8 +3109,8 @@ - "SCRIPT_NAME" => "vendor/bin/phpunit" - "SCRIPT_FILENAME" => "vendor/bin/phpunit" - "SERVER_PROTOCOL" => "HTTP/1.1" -- "REQUEST_TIME" => 1642777912 -- "REQUEST_TIME_FLOAT" => 1642777912.922 +- "REQUEST_TIME" => 1643035444 +- "REQUEST_TIME_FLOAT" => 1643035444.6835 - "WRITE_DIFFS" => "1" - "TERM_PROGRAM" => "iTerm.app" - "PHP_BINARY" => "/usr/local/Cellar/php@7.4/7.4.26_1.reinstall/bin/php" @@ -3073,7 +3119,7 @@ - "SHELL" => "/bin/zsh" - "TMPDIR" => "/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/" - "TERM_PROGRAM_VERSION" => "3.5.0beta4" -- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/rXInRP|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" +- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/AYiABf|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" - "ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" => "fg=240" - "TERM_SESSION_ID" => "w0t0p0:CCB91CBF-8B4F-4D42-A80C-5604BE31C02A" - "ZSH" => "/Users/inxilpro/.oh-my-zsh" @@ -5768,10 +5814,10 @@ - #name: "schedule:run" - #description: "Run the scheduled commands" - #schedule: null -- #startedAt: Illuminate\Support\Carbon @1642777913 { +- #startedAt: Illuminate\Support\Carbon @1643035445 { - #endOfTime: false - #startOfTime: false -- #constructedObjectId: "000000002366afac000000002f03d026" +- #constructedObjectId: "0000000018631abe0000000058605208" - #localMonthsOverflow: null - #localYearsOverflow: null - #localStrictModeEnabled: null @@ -5789,7 +5835,7 @@ - ] - #dumpLocale: null - #dumpDateProperties: null -- date: 2022-01-21 10:11:53.542732 America/New_York (-05:00) +- date: 2022-01-24 09:44:05.483643 America/New_York (-05:00) - } - #eventsRan: false - #dispatcher: null @@ -10752,6 +10798,19 @@ - #escapeWhenCastingToString: false - } - } +- "Glhd\LaravelDumper\Casters\BuilderCaster" => Glhd\LaravelDumper\Casters\BuilderCaster {} +- "Glhd\LaravelDumper\Casters\ModelCaster" => Glhd\LaravelDumper\Casters\ModelCaster { +- #attribute_order: array:7 [ +- 0 => "id" +- 1 => "*_id" +- 2 => "*" +- 3 => "*_at" +- 4 => "created_at" +- 5 => "updated_at" +- 6 => "deleted_at" +- ] +- } +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => Glhd\LaravelDumper\Casters\DatabaseConnectionCaster {} - ] - #scopedInstances: [] - #aliases: array:79 [ @@ -11267,7 +11326,7 @@ #eagerLoad: array:1 [ "company" => Closure() { class: "Illuminate\Database\Eloquent\Builder" -@@ -11261,34 +14,5 @@ +@@ -11320,34 +14,5 @@ line: "1364 to 1366" } ] diff --git a/diffs/eloquent-model.diff b/diffs/eloquent-model.diff index ede18bb..3a21948 100644 --- a/diffs/eloquent-model.diff +++ b/diffs/eloquent-model.diff @@ -1,5 +1,5 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 +--- Before 2022-01-24 09:44:05.000000000 -0500 ++++ After 2022-01-24 09:44:05.000000000 -0500 @@ -1,25 +1,28 @@ Glhd\LaravelDumper\Tests\User { - #guarded: [] @@ -16,8 +16,8 @@ + +"company_id": 1 + +"email": "foo@bar.com" + +"name": "Chris" -+ +"created_at": "2022-01-21 10:11:53" -+ +"updated_at": "2022-01-21 10:11:53" ++ +"created_at": "2022-01-24 09:44:05" ++ +"updated_at": "2022-01-24 09:44:05" + isDirty(): true +exists: true +wasRecentlyCreated: true @@ -26,15 +26,15 @@ - "name" => "Chris" - "email" => "foo@bar.com" - "company_id" => 1 -- "updated_at" => "2022-01-21 10:11:53" -- "created_at" => "2022-01-21 10:11:53" +- "updated_at" => "2022-01-24 09:44:05" +- "created_at" => "2022-01-24 09:44:05" - "id" => 1 + #relations: array:1 [ + "company" => Glhd\LaravelDumper\Tests\Company { + +"id": 1 + +"name": "Galahad" -+ +"created_at": "2022-01-21 10:11:53" -+ +"updated_at": "2022-01-21 10:11:53" ++ +"created_at": "2022-01-24 09:44:05" ++ +"updated_at": "2022-01-24 09:44:05" + isDirty(): false + +exists: true + +wasRecentlyCreated: true @@ -76,14 +76,14 @@ - #escapeWhenCastingToString: false - #attributes: array:4 [ - "name" => "Galahad" -- "updated_at" => "2022-01-21 10:11:53" -- "created_at" => "2022-01-21 10:11:53" +- "updated_at" => "2022-01-24 09:44:05" +- "created_at" => "2022-01-24 09:44:05" - "id" => 1 - ] - #original: array:4 [ - "name" => "Galahad" -- "updated_at" => "2022-01-21 10:11:53" -- "created_at" => "2022-01-21 10:11:53" +- "updated_at" => "2022-01-24 09:44:05" +- "created_at" => "2022-01-24 09:44:05" - "id" => 1 - ] - #changes: [] diff --git a/diffs/eloquent-relation.diff b/diffs/eloquent-relation.diff index bbbf24c..29d9187 100644 --- a/diffs/eloquent-relation.diff +++ b/diffs/eloquent-relation.diff @@ -1,6 +1,6 @@ ---- Before 2022-01-21 10:11:54.000000000 -0500 -+++ After 2022-01-21 10:11:54.000000000 -0500 -@@ -1,11356 +1,12 @@ +--- Before 2022-01-24 09:44:06.000000000 -0500 ++++ After 2022-01-24 09:44:06.000000000 -0500 +@@ -1,11415 +1,12 @@ Illuminate\Database\Eloquent\Relations\BelongsTo { - #child: Glhd\LaravelDumper\Tests\User {#1 - #guarded: [] @@ -21,16 +21,16 @@ - "name" => "John" - "email" => "foo@bar.com" - "company_id" => 1 -- "updated_at" => "2022-01-21 10:11:53" -- "created_at" => "2022-01-21 10:11:53" +- "updated_at" => "2022-01-24 09:44:05" +- "created_at" => "2022-01-24 09:44:05" - ] - #original: array:6 [ - "id" => 1 - "name" => "John" - "email" => "foo@bar.com" - "company_id" => 1 -- "updated_at" => "2022-01-21 10:11:53" -- "created_at" => "2022-01-21 10:11:53" +- "updated_at" => "2022-01-24 09:44:05" +- "created_at" => "2022-01-24 09:44:05" - ] - #changes: [] - #casts: [] @@ -267,7 +267,6 @@ - 7 => "Glhd\LaravelDumper\Casters\HeaderBagCaster" - 8 => "Glhd\LaravelDumper\Casters\ResponseCaster" - ] -- #base_dir: "/Users/inxilpro/Development/open-source/laravel-dumper" - #app: Illuminate\Foundation\Application {#6} - #bootingCallbacks: [] - #bootedCallbacks: [] @@ -495,7 +494,7 @@ - 0 => "/" - 1 => "\" - ] -- #resolved: array:116 [ +- #resolved: array:119 [ - "Illuminate\Foundation\PackageManifest" => true - "Orchestra\Testbench\Bootstrap\LoadConfiguration" => true - "Illuminate\Foundation\Bootstrap\LoadConfiguration" => true @@ -612,6 +611,9 @@ - "Illuminate\Console\OutputStyle" => true - "db.transactions" => true - "Illuminate\Database\Schema\Blueprint" => true +- "Glhd\LaravelDumper\Casters\BuilderCaster" => true +- "Glhd\LaravelDumper\Casters\ModelCaster" => true +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => true - ] - #bindings: array:172 [ - "Illuminate\Foundation\Mix" => array:2 [ @@ -2262,7 +2264,7 @@ - ] - ] - #methodBindings: [] -- #instances: array:119 [ +- #instances: array:122 [ - "path" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/app" - "path.base" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel" - "path.lang" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/resources/lang" @@ -2276,6 +2278,8 @@ - "Illuminate\Container\Container" => Illuminate\Foundation\Application {#6} - "Illuminate\Foundation\PackageManifest" => Orchestra\Testbench\Foundation\PackageManifest { - #testbench: Glhd\LaravelDumper\Tests\DatabaseCasterTest {#36 +- #write_diff_if_configured: true +- #diff_count: 0 - #baseUrl: "http://localhost" - #backupGlobals: null - #backupGlobalsExcludeList: [] @@ -2312,11 +2316,15 @@ - -statusMessage: "" - -numAssertions: 0 - -result: PHPUnit\Framework\TestResult { -- -passed: array:8 [ +- -passed: array:11 [ - "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => array:2 [ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\CasterTest::test_container" => array:2 [ - "result" => null - "size" => -1 @@ -2333,6 +2341,14 @@ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => array:2 [ +- "result" => null +- "size" => -1 +- ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => array:2 [ - "result" => null - "size" => -1 @@ -2346,8 +2362,9 @@ - "size" => -1 - ] - ] -- -passedTestClasses: array:1 [ +- -passedTestClasses: array:2 [ - 0 => "Glhd\LaravelDumper\Tests\CasterTest" +- 1 => "Glhd\LaravelDumper\Tests\CustomCasterTest" - ] - -currentTestSuiteFailed: false - -errors: [] @@ -2362,7 +2379,7 @@ - 0 => PHPUnit\Runner\ResultCacheExtension { - -cache: PHPUnit\Runner\DefaultTestResultCache { - -cacheFilename: "/Users/inxilpro/Development/open-source/laravel-dumper/.phpunit.result.cache" -- -defects: array:16 [ +- -defects: array:27 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 3 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 3 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 3 @@ -2379,8 +2396,19 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 4 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 3 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 4 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 4 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 3 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 3 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 4 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 3 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 3 - ] -- -times: array:25 [ +- -times: array:43 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 0.103 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 0.06 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 0.146 @@ -2397,15 +2425,33 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 0.024 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 0.138 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 0.025 -- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.067 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.023 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.021 -- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.024 -- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.023 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.109 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.288 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.287 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.042 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.07 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.024 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.022 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.026 +- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.024 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.115 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.297 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.302 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.302 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 0.056 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 0.055 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 0.057 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_reordering_parameters" => 0.013 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_only_keeping_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_excluding_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 0.031 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_loads_helper_functions" => 0.058 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 0.059 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 0.102 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_get_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_and_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_default_filtering" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => 0.013 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 0.042 - ] - } - } @@ -2413,13 +2459,13 @@ - -lastTestWasNotSuccessful: false - } - 1 => PHPUnit\TextUI\DefaultResultPrinter { -- #column: 8 -- #maxColumn: 67 +- #column: 11 +- #maxColumn: 65 - #lastTestFailed: false -- #numAssertions: 8 -- #numTests: 9 -- #numTestsRun: 8 -- #numTestsWidth: 1 +- #numAssertions: 14 +- #numTests: 22 +- #numTestsRun: 11 +- #numTestsWidth: 2 - #colors: true - #debug: false - #verbose: false @@ -2428,15 +2474,15 @@ - -defectListPrinted: false - -timer: SebastianBergmann\Timer\Timer { - -startTimes: array:1 [ -- 0 => 64535660256965.0 +- 0 => 2.7598378317729E+14 - ] - } - -stream: null - -isPhpStream: null - } - ] -- -runTests: 9 -- -time: 0.841421251 +- -runTests: 12 +- -time: 1.023566474 - -codeCoverage: null - -convertDeprecationsToExceptions: false - -convertErrorsToExceptions: true @@ -3123,8 +3169,8 @@ - "SCRIPT_NAME" => "vendor/bin/phpunit" - "SCRIPT_FILENAME" => "vendor/bin/phpunit" - "SERVER_PROTOCOL" => "HTTP/1.1" -- "REQUEST_TIME" => 1642777912 -- "REQUEST_TIME_FLOAT" => 1642777912.922 +- "REQUEST_TIME" => 1643035444 +- "REQUEST_TIME_FLOAT" => 1643035444.6835 - "WRITE_DIFFS" => "1" - "TERM_PROGRAM" => "iTerm.app" - "PHP_BINARY" => "/usr/local/Cellar/php@7.4/7.4.26_1.reinstall/bin/php" @@ -3133,7 +3179,7 @@ - "SHELL" => "/bin/zsh" - "TMPDIR" => "/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/" - "TERM_PROGRAM_VERSION" => "3.5.0beta4" -- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/rXInRP|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" +- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/AYiABf|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" - "ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" => "fg=240" - "TERM_SESSION_ID" => "w0t0p0:CCB91CBF-8B4F-4D42-A80C-5604BE31C02A" - "ZSH" => "/Users/inxilpro/.oh-my-zsh" @@ -5828,10 +5874,10 @@ - #name: "schedule:run" - #description: "Run the scheduled commands" - #schedule: null -- #startedAt: Illuminate\Support\Carbon @1642777913 { +- #startedAt: Illuminate\Support\Carbon @1643035445 { - #endOfTime: false - #startOfTime: false -- #constructedObjectId: "000000002366af01000000002f03d026" +- #constructedObjectId: "0000000018631a4e0000000058605208" - #localMonthsOverflow: null - #localYearsOverflow: null - #localStrictModeEnabled: null @@ -5849,7 +5895,7 @@ - ] - #dumpLocale: null - #dumpDateProperties: null -- date: 2022-01-21 10:11:53.829555 America/New_York (-05:00) +- date: 2022-01-24 09:44:05.785447 America/New_York (-05:00) - } - #eventsRan: false - #dispatcher: null @@ -10812,6 +10858,19 @@ - #escapeWhenCastingToString: false - } - } +- "Glhd\LaravelDumper\Casters\BuilderCaster" => Glhd\LaravelDumper\Casters\BuilderCaster {} +- "Glhd\LaravelDumper\Casters\ModelCaster" => Glhd\LaravelDumper\Casters\ModelCaster { +- #attribute_order: array:7 [ +- 0 => "id" +- 1 => "*_id" +- 2 => "*" +- 3 => "*_at" +- 4 => "created_at" +- 5 => "updated_at" +- 6 => "deleted_at" +- ] +- } +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => Glhd\LaravelDumper\Casters\DatabaseConnectionCaster {} - ] - #scopedInstances: [] - #aliases: array:79 [ diff --git a/diffs/query-builder.diff b/diffs/query-builder.diff index 84258bb..c6798cb 100644 --- a/diffs/query-builder.diff +++ b/diffs/query-builder.diff @@ -1,6 +1,6 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 -@@ -1,11217 +1,10 @@ +--- Before 2022-01-24 09:44:05.000000000 -0500 ++++ After 2022-01-24 09:44:05.000000000 -0500 +@@ -1,11264 +1,10 @@ Illuminate\Database\Query\Builder { - +connection: Illuminate\Database\SQLiteConnection { - #pdo: PDO { @@ -210,7 +210,6 @@ - 7 => "Glhd\LaravelDumper\Casters\HeaderBagCaster" - 8 => "Glhd\LaravelDumper\Casters\ResponseCaster" - ] -- #base_dir: "/Users/inxilpro/Development/open-source/laravel-dumper" - #app: Illuminate\Foundation\Application {#5} - #bootingCallbacks: [] - #bootedCallbacks: [] @@ -438,7 +437,7 @@ - 0 => "/" - 1 => "\" - ] -- #resolved: array:116 [ +- #resolved: array:118 [ - "Illuminate\Foundation\PackageManifest" => true - "Orchestra\Testbench\Bootstrap\LoadConfiguration" => true - "Illuminate\Foundation\Bootstrap\LoadConfiguration" => true @@ -555,6 +554,8 @@ - "Illuminate\Console\OutputStyle" => true - "db.transactions" => true - "Illuminate\Database\Schema\Blueprint" => true +- "Glhd\LaravelDumper\Casters\BuilderCaster" => true +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => true - ] - #bindings: array:172 [ - "Illuminate\Foundation\Mix" => array:2 [ @@ -2205,7 +2206,7 @@ - ] - ] - #methodBindings: [] -- #instances: array:119 [ +- #instances: array:121 [ - "path" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/app" - "path.base" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel" - "path.lang" => "/Users/inxilpro/Development/open-source/laravel-dumper/vendor/orchestra/testbench-core/laravel/resources/lang" @@ -2219,6 +2220,8 @@ - "Illuminate\Container\Container" => Illuminate\Foundation\Application {#5} - "Illuminate\Foundation\PackageManifest" => Orchestra\Testbench\Foundation\PackageManifest { - #testbench: Glhd\LaravelDumper\Tests\DatabaseCasterTest {#35 +- #write_diff_if_configured: true +- #diff_count: 0 - #baseUrl: "http://localhost" - #backupGlobals: null - #backupGlobalsExcludeList: [] @@ -2255,11 +2258,15 @@ - -statusMessage: "" - -numAssertions: 0 - -result: PHPUnit\Framework\TestResult { -- -passed: array:6 [ +- -passed: array:9 [ - "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => array:2 [ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\CasterTest::test_container" => array:2 [ - "result" => null - "size" => -1 @@ -2276,13 +2283,22 @@ - "result" => null - "size" => -1 - ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => array:2 [ +- "result" => null +- "size" => -1 +- ] +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => array:2 [ +- "result" => null +- "size" => -1 +- ] - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => array:2 [ - "result" => null - "size" => -1 - ] - ] -- -passedTestClasses: array:1 [ +- -passedTestClasses: array:2 [ - 0 => "Glhd\LaravelDumper\Tests\CasterTest" +- 1 => "Glhd\LaravelDumper\Tests\CustomCasterTest" - ] - -currentTestSuiteFailed: false - -errors: [] @@ -2297,7 +2313,7 @@ - 0 => PHPUnit\Runner\ResultCacheExtension { - -cache: PHPUnit\Runner\DefaultTestResultCache { - -cacheFilename: "/Users/inxilpro/Development/open-source/laravel-dumper/.phpunit.result.cache" -- -defects: array:16 [ +- -defects: array:27 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 3 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 3 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 3 @@ -2314,8 +2330,19 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 4 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 3 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 4 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 4 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 3 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 3 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 4 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 3 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 3 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 3 - ] -- -times: array:25 [ +- -times: array:43 [ - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_the_internals_from_the_container" => 0.103 - "Glhd\LaravelDumper\Tests\LaravelCastsTest::test_it_cuts_most_internals_from_a_container" => 0.06 - "Glhd\LaravelDumper\Tests\ModelCastTest::test_model" => 0.146 @@ -2332,15 +2359,33 @@ - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_response" => 0.024 - "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_it_formats_very_long_sql" => 0.138 - "Glhd\LaravelDumper\Tests\CasterTest::test_it_dumps_a_request" => 0.025 -- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.067 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.023 -- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.021 -- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.024 -- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.023 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.109 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.039 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.039 -- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.042 +- "Glhd\LaravelDumper\Tests\CasterTest::test_carbon_date" => 0.07 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container" => 0.024 +- "Glhd\LaravelDumper\Tests\CasterTest::test_container_nested" => 0.022 +- "Glhd\LaravelDumper\Tests\CasterTest::test_request" => 0.026 +- "Glhd\LaravelDumper\Tests\CasterTest::test_response" => 0.024 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_model" => 0.115 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_query_builder" => 0.292 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_builder" => 0.307 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_eloquent_relation" => 0.302 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_reordering_parameters" => 0.056 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_only_keeping_specific_parameters" => 0.055 +- "Glhd\LaravelDumper\Tests\ParametersTest::test_excluding_specific_parameters" => 0.057 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_has_method" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_reordering_parameters" => 0.013 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_only_keeping_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_excluding_specific_parameters" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_caster" => 0.031 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_loads_helper_functions" => 0.058 +- "Glhd\LaravelDumper\Tests\ServiceProviderTest::test_it_only_loads_in_development" => 0.059 +- "Glhd\LaravelDumper\Tests\CasterTest::test_package_can_be_disabled" => 0.102 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_get_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_copy_and_cut_methods" => 0.012 +- "Glhd\LaravelDumper\Tests\PropertiesTest::test_default_filtering" => 0.012 +- "Glhd\LaravelDumper\Tests\CustomCasterTest::test_custom_casters_cannot_be_registered" => 0.013 +- "Glhd\LaravelDumper\Tests\DatabaseCasterTest::test_unexpected_database_connections" => 0.042 - ] - } - } @@ -2348,13 +2393,13 @@ - -lastTestWasNotSuccessful: false - } - 1 => PHPUnit\TextUI\DefaultResultPrinter { -- #column: 6 -- #maxColumn: 67 +- #column: 9 +- #maxColumn: 65 - #lastTestFailed: false -- #numAssertions: 6 -- #numTests: 9 -- #numTestsRun: 6 -- #numTestsWidth: 1 +- #numAssertions: 12 +- #numTests: 22 +- #numTestsRun: 9 +- #numTestsWidth: 2 - #colors: true - #debug: false - #verbose: false @@ -2363,15 +2408,15 @@ - -defectListPrinted: false - -timer: SebastianBergmann\Timer\Timer { - -startTimes: array:1 [ -- 0 => 64535660256965.0 +- 0 => 2.7598378317729E+14 - ] - } - -stream: null - -isPhpStream: null - } - ] -- -runTests: 7 -- -time: 0.266152861 +- -runTests: 10 +- -time: 0.425094713 - -codeCoverage: null - -convertDeprecationsToExceptions: false - -convertErrorsToExceptions: true @@ -3058,8 +3103,8 @@ - "SCRIPT_NAME" => "vendor/bin/phpunit" - "SCRIPT_FILENAME" => "vendor/bin/phpunit" - "SERVER_PROTOCOL" => "HTTP/1.1" -- "REQUEST_TIME" => 1642777912 -- "REQUEST_TIME_FLOAT" => 1642777912.922 +- "REQUEST_TIME" => 1643035444 +- "REQUEST_TIME_FLOAT" => 1643035444.6835 - "WRITE_DIFFS" => "1" - "TERM_PROGRAM" => "iTerm.app" - "PHP_BINARY" => "/usr/local/Cellar/php@7.4/7.4.26_1.reinstall/bin/php" @@ -3068,7 +3113,7 @@ - "SHELL" => "/bin/zsh" - "TMPDIR" => "/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/" - "TERM_PROGRAM_VERSION" => "3.5.0beta4" -- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/rXInRP|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" +- "XDEBUG_HANDLER_SETTINGS" => "/private/var/folders/wq/7r254byn65xbhgpsfn__xcl00000gn/T/AYiABf|1|*|*|/usr/local/etc/php/7.4/php.ini:/usr/local/etc/php/7.4/conf.d/error_log.ini:/usr/local/etc/php/7.4/conf.d/ext-imagick.ini:/usr/local/etc/php/7.4/conf.d/ext-opcache.ini:/usr/local/etc/php/7.4/conf.d/ext-xdebug.ini:/usr/local/etc/php/7.4/conf.d/php-memory-limits.ini|2.9.6" - "ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE" => "fg=240" - "TERM_SESSION_ID" => "w0t0p0:CCB91CBF-8B4F-4D42-A80C-5604BE31C02A" - "ZSH" => "/Users/inxilpro/.oh-my-zsh" @@ -5763,10 +5808,10 @@ - #name: "schedule:run" - #description: "Run the scheduled commands" - #schedule: null -- #startedAt: Illuminate\Support\Carbon @1642777913 { +- #startedAt: Illuminate\Support\Carbon @1643035445 { - #endOfTime: false - #startOfTime: false -- #constructedObjectId: "000000002366a9de000000002f03d026" +- #constructedObjectId: "000000001863189d0000000058605208" - #localMonthsOverflow: null - #localYearsOverflow: null - #localStrictModeEnabled: null @@ -5784,7 +5829,7 @@ - ] - #dumpLocale: null - #dumpDateProperties: null -- date: 2022-01-21 10:11:53.253927 America/New_York (-05:00) +- date: 2022-01-24 09:44:05.187021 America/New_York (-05:00) - } - #eventsRan: false - #dispatcher: null @@ -10747,6 +10792,8 @@ - #escapeWhenCastingToString: false - } - } +- "Glhd\LaravelDumper\Casters\BuilderCaster" => Glhd\LaravelDumper\Casters\BuilderCaster {} +- "Glhd\LaravelDumper\Casters\DatabaseConnectionCaster" => Glhd\LaravelDumper\Casters\DatabaseConnectionCaster {} - ] - #scopedInstances: [] - #aliases: array:79 [ diff --git a/diffs/request.diff b/diffs/request.diff index dac9261..a1cb97c 100644 --- a/diffs/request.diff +++ b/diffs/request.diff @@ -1,6 +1,6 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 -@@ -1,86 +1,42 @@ +--- Before 2022-01-24 09:44:04.000000000 -0500 ++++ After 2022-01-24 09:44:04.000000000 -0500 +@@ -1,86 +1,44 @@ Illuminate\Http\Request { - #json: null - #convertedFiles: null @@ -31,8 +31,8 @@ - "SCRIPT_NAME" => "" - "SCRIPT_FILENAME" => "" - "SERVER_PROTOCOL" => "HTTP/1.1" -- "REQUEST_TIME" => 1642777913 -- "REQUEST_TIME_FLOAT" => 1642777913.0884 +- "REQUEST_TIME" => 1643035444 +- "REQUEST_TIME_FLOAT" => 1643035444.9632 - "PATH_INFO" => "" - "REQUEST_METHOD" => "GET" - "REQUEST_URI" => "/1" @@ -55,8 +55,8 @@ + SCRIPT_NAME: "" + SCRIPT_FILENAME: "" + SERVER_PROTOCOL: "HTTP/1.1" -+ REQUEST_TIME: 1642777913 -+ REQUEST_TIME_FLOAT: 1642777913.0884 ++ REQUEST_TIME: 1643035444 ++ REQUEST_TIME_FLOAT: 1643035444.9632 + PATH_INFO: "" + REQUEST_METHOD: "GET" + REQUEST_URI: "/1" @@ -109,9 +109,9 @@ - -isSafeContentPreferred: null pathInfo: "/1" requestUri: "/1" -- baseUrl: "" -- basePath: "" + baseUrl: "" + basePath: "" method: "GET" format: "html" -+ …40 ++ …19 } diff --git a/diffs/response.diff b/diffs/response.diff index fe4ecfd..c544d45 100644 --- a/diffs/response.diff +++ b/diffs/response.diff @@ -1,5 +1,5 @@ ---- Before 2022-01-21 10:11:53.000000000 -0500 -+++ After 2022-01-21 10:11:53.000000000 -0500 +--- Before 2022-01-24 09:44:04.000000000 -0500 ++++ After 2022-01-24 09:44:04.000000000 -0500 @@ -1,29 +1,13 @@ Illuminate\Http\Response { +headers: Symfony\Component\HttpFoundation\ResponseHeaderBag { @@ -17,11 +17,11 @@ - 0 => "no-cache, private" - ] - "date" => array:1 [ -- 0 => "Fri, 21 Jan 2022 15:11:53 GMT" +- 0 => "Mon, 24 Jan 2022 14:44:04 GMT" - ] - ] + cache-control: "no-cache, private" -+ date: "Fri, 21 Jan 2022 15:11:53 GMT" ++ date: "Mon, 24 Jan 2022 14:44:04 GMT" #cacheControl: [] } #content: "Hello world." diff --git a/tests/CasterTest.php b/tests/CasterTest.php index a53efae..b018fab 100644 --- a/tests/CasterTest.php +++ b/tests/CasterTest.php @@ -35,27 +35,23 @@ public function test_carbon_date(): void public function test_package_can_be_disabled(): void { - $this->write_diff_if_configured = false; - - try { - CustomCaster::for(static::class) - ->only([]) - ->virtual('foo', fn() => 'bar'); - - $getLineCount = fn() => substr_count($this->getDump($this), "\n") + 1; - - $this->assertEquals(4, $getLineCount()); - - Caster::disable(); - - $this->assertGreaterThan(100, $getLineCount()); - - Caster::enable(); - - $this->assertEquals(4, $getLineCount()); - } finally { - $this->write_diff_if_configured = true; - } + $this->withoutWritingDiffs(); + + CustomCaster::for(static::class) + ->only([]) + ->virtual('foo', fn() => 'bar'); + + $getLineCount = fn() => substr_count($this->getDump($this), "\n") + 1; + + $this->assertEquals(4, $getLineCount()); + + Caster::disable(); + + $this->assertGreaterThan(100, $getLineCount()); + + Caster::enable(); + + $this->assertEquals(4, $getLineCount()); } public function test_container(): void diff --git a/tests/TestCase.php b/tests/TestCase.php index 69af7e7..1125072 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -18,11 +18,22 @@ abstract class TestCase extends Orchestra protected bool $write_diff_if_configured = true; + protected int $diff_count = 0; + protected function setUp(): void { parent::setUp(); Caster::enable(); + $this->write_diff_if_configured = true; + $this->diff_count = 0; + } + + protected function withoutWritingDiffs(): self + { + $this->write_diff_if_configured = false; + + return $this; } protected function getPackageProviders($app) @@ -66,6 +77,11 @@ protected function writeDiff($before, $after) [$_, $_, $_, $caller] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 4); $name = Str::of($caller['function'])->after('test_')->replace('_', '-'); + $this->diff_count++; + if ($this->diff_count > 1) { + $name .= "-{$this->diff_count}"; + } + $before_file = "{$path}/{$name}.1.txt"; $after_file = "{$path}/{$name}.2.txt";