Skip to content

Commit

Permalink
A few testing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
inxilpro committed Jan 24, 2022
1 parent cd858ca commit d707ad0
Show file tree
Hide file tree
Showing 13 changed files with 358 additions and 162 deletions.
8 changes: 4 additions & 4 deletions diffs/carbon-date.diff
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,5 +24,5 @@
- #dumpLocale: null
- #dumpDateProperties: null
- date: 2022-01-18 19:44:02.572622 America/New_York (-05:00)
+23
+12
}
4 changes: 2 additions & 2 deletions diffs/container-nested.diff
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions diffs/container.diff
Original file line number Diff line number Diff line change
@@ -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 [
Expand Down
7 changes: 7 additions & 0 deletions diffs/custom-caster-2.diff
Original file line number Diff line number Diff line change
@@ -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"
}
12 changes: 12 additions & 0 deletions diffs/custom-caster.diff
Original file line number Diff line number Diff line change
@@ -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
}
129 changes: 94 additions & 35 deletions diffs/eloquent-builder.diff

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions diffs/eloquent-model.diff
Original file line number Diff line number Diff line change
@@ -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: []
Expand All @@ -16,8 +16,8 @@
+ +"company_id": 1
+ +"email": "[email protected]"
+ +"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
Expand All @@ -26,15 +26,15 @@
- "name" => "Chris"
- "email" => "[email protected]"
- "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
Expand Down Expand Up @@ -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: []
Expand Down
135 changes: 97 additions & 38 deletions diffs/eloquent-relation.diff

Large diffs are not rendered by default.

115 changes: 81 additions & 34 deletions diffs/query-builder.diff
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 [
Expand Down Expand Up @@ -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"
Expand All @@ -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: []
Expand Down Expand Up @@ -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
Expand All @@ -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: []
Expand All @@ -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
Expand All @@ -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
Expand All @@ -2332,29 +2359,47 @@
- "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
- ]
- }
- }
- ]
- -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
Expand All @@ -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
Expand Down Expand Up @@ -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/[email protected]/7.4.26_1.reinstall/bin/php"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 [
Expand Down
Loading

0 comments on commit d707ad0

Please sign in to comment.