From 572ef56c45b3589eb9f573dc93d0a10cd23bedd7 Mon Sep 17 00:00:00 2001 From: miladev-ent <98118400+milwad-dev@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:46:18 +0330 Subject: [PATCH 1/4] Create MenuBarTest.php --- tests/MenuBar/MenuBarTest.php | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/MenuBar/MenuBarTest.php diff --git a/tests/MenuBar/MenuBarTest.php b/tests/MenuBar/MenuBarTest.php new file mode 100644 index 00000000..50cce95b --- /dev/null +++ b/tests/MenuBar/MenuBarTest.php @@ -0,0 +1,3 @@ + Date: Fri, 21 Jul 2023 15:40:07 +0330 Subject: [PATCH 2/4] install guzzle http --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index be7f4a1c..73056315 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ ], "require": { "php": "^8.1", + "guzzlehttp/guzzle": "^7.7", "illuminate/contracts": "^10.0", "spatie/laravel-package-tools": "^1.14.0", "symfony/finder": "^6.2" From d992c76dbd3f78e5760eb059539bbbc046ec4886 Mon Sep 17 00:00:00 2001 From: miladev-ent <98118400+milwad-dev@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:40:28 +0330 Subject: [PATCH 3/4] add test for MenuBar with create method --- tests/MenuBar/MenuBarTest.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/MenuBar/MenuBarTest.php b/tests/MenuBar/MenuBarTest.php index 50cce95b..ec19c7b6 100644 --- a/tests/MenuBar/MenuBarTest.php +++ b/tests/MenuBar/MenuBarTest.php @@ -1,3 +1,26 @@ set('nativephp-internal.api_url', 'https://jsonplaceholder.typicode.com/todos/1'); + + $menuBar = MenuBar::create() + ->showDockIcon() + ->alwaysOnTop() + ->label('milwad') + ->icon('nativephp.png') + ->url('https://github.com/milwad-dev') + ->withContextMenu( + Menu::new()->label('My Application')->quit(), + ); + $menuBarArray = $menuBar->toArray(); + + $this->assertTrue($menuBarArray['showDockIcon']); + $this->assertTrue($menuBarArray['alwaysOnTop']); + $this->assertEquals('milwad', $menuBarArray['label']); + $this->assertEquals('https://github.com/milwad-dev', $menuBarArray['url']); + $this->assertEquals('nativephp.png', $menuBarArray['icon']); + $this->assertIsArray($menuBarArray['contextMenu']); +}); From 9a21d5da2c9342b8d0c39dc7604ee595b69bfb5c Mon Sep 17 00:00:00 2001 From: miladev-ent <98118400+milwad-dev@users.noreply.github.com> Date: Fri, 21 Jul 2023 22:49:33 +0330 Subject: [PATCH 4/4] remove `guzzlehttp/guzzle` --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 73056315..be7f4a1c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,6 @@ ], "require": { "php": "^8.1", - "guzzlehttp/guzzle": "^7.7", "illuminate/contracts": "^10.0", "spatie/laravel-package-tools": "^1.14.0", "symfony/finder": "^6.2"