Skip to content

Commit 7fcc16e

Browse files
committed
Merge branch 'release/2.0.0-beta.5'
2 parents 9486308 + 4b97f71 commit 7fcc16e

File tree

7 files changed

+43
-27
lines changed

7 files changed

+43
-27
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* text=auto
22
*.css linguist-vendored
33
*.less linguist-vendored
4+
public/templates/adminlte205/* linguist-vendored

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
/vendor
33
/node_modules
44
.env
5-
tests/logs/output.html
6-
tests/tests/logs/output.html
5+
/tests/logs
6+
/packages

composer.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
2-
"name": "SourceMod-Store/WebPanel-Core",
2+
"name": "sourcemod-store/wp-core",
33
"description": "The Core for the New WebPanel",
4-
"keywords": ["sourcemod", "store", "WebPanel", "laravel"],
5-
"license": "AGPL",
4+
"keywords": ["sourcemod", "store", "sourcemod-store-webpanel", "laravel"],
5+
"license": "AGPL-3.0",
6+
"authors": [
7+
{
8+
"name": "Werner Maisl",
9+
"email": "dev@myhomenet.at"
10+
}
11+
],
612
"type": "project",
713
"require": {
814
"php": ">=5.5.9",

resources/views/templates/adminlte205/webpanel/app.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
<footer class="main-footer">
6464
<div class="pull-right hidden-xs">
65-
<b>Version</b> 2.0.0-beta.4
65+
<b>Version</b> 2.0.0-beta.5
6666
</div>
6767
Copyright &copy; 2013-2015 Store Plugin: <strong>Alon Gubkin</strong>, <strong>Keith Warren</strong> - WebPanel: <strong>Werner Maisl</strong>. All rights reserved.
6868
</footer>

resources/views/templates/adminlte205/webpanel/store/categories/_actions.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div>
22
<div style="float: right">
3-
{!! Form::open(['method' => 'DELETE', 'url' => route('webpanel.store.users.destroy',$category->id)]) !!}
3+
{!! Form::open(['method' => 'DELETE', 'url' => route('webpanel.store.categories.destroy',$category->id)]) !!}
44
{!! Form::submit('Remove ' . $category->id,['class' => 'btn btn-danger']) !!}
55
{!! Form::close() !!}
66
</div>
77
<div style="float: right">
8-
{!! Form::open(['method' => 'GET', 'url' => route('webpanel.store.users.edit',$category->id)]) !!}
8+
{!! Form::open(['method' => 'GET', 'url' => route('webpanel.store.categories.edit',$category->id)]) !!}
99
{!! Form::submit('Edit ' . $category->id,['class' => 'btn btn-danger']) !!}
1010
{!! Form::close() !!}
1111
</div>

tests/StoreCategoryTest.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function check_if_overview_can_be_accessed()
2020
$this->visit('/webpanel/store/categories')->see('All Categories');
2121
}
2222

23-
/** @test TODO: Fix the test to support the jquery datatables
23+
2424
public function create_category_and_check_if_exists()
2525
{
2626
//Delete category if already exists
@@ -40,31 +40,29 @@ public function create_category_and_check_if_exists()
4040
$this->type('#3751d5', 'web_color');
4141
$this->press('Create Category');
4242

43-
$this->see("Int Test Cat"); //Check for the display name
44-
$this->see('integration_test'); // Check for the Requrie-Plugin
45-
4643
//Get the ID of the Category
4744
$category_id = $this->get_category_id();
4845

49-
//Visit the Edit page
50-
$this->press('Edit ' . $category_id);
46+
$this->visit('/webpanel/store/categories/'.$category_id.'/edit');
5147
$this->see("Int Test Cat"); //Check for the display name
52-
$this->see('integration_test'); // Check for the Requrie-Plugin
48+
$this->see('integration_test'); // Check for the Require-Plugin
5349
$this->see('Integration Test Category'); //Check for the description
5450

5551
//Make a Edit and Save
5652
$this->type('integration_test_2', 'require_plugin');
5753
$this->press('Edit Category');
5854

5955
//Confirm the edit
56+
$this->visit('/webpanel/store/categories/'.$category_id.'/edit');
6057
$this->see('integration_test_2');
6158

6259
//Delete the category
63-
$this->press('Remove ' . $category_id);
60+
//TODO: Add Remove and Remove + Refund button to the edit page so removing a category can be testet
61+
//$this->press('Remove ' . $category_id);
6462

6563
//Confirm that its deleted
66-
$this->assertNull(StoreCategory::where('display_name', 'test')->first());
67-
}*/
64+
//$this->assertNull(StoreCategory::where('display_name', 'test')->first());
65+
}
6866

6967
private function get_category_id()
7068
{

tests/StoreItemTest.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function check_if_overview_can_be_accessed()
1818
$this->login_with_admin_user();
1919

2020
//Check if overview can be accessed
21-
$this->visit('/webpanel/store/categories')->see('All Categories');
21+
$this->visit('/webpanel/store/items')->see('All Items');
2222
}
2323

2424
/** @test */
@@ -43,35 +43,40 @@ public function create_item_and_check_if_exists()
4343
$this->type('integration_test', 'type');
4444
$this->type('integration_slot', 'loadout_slot');
4545
$this->type('7669035', 'price');
46-
$this->type('test-cat', 'category_id');
46+
$this->type($this->get_category_id(), 'category_id');
4747

4848
$this->press('Create Item');
4949

50-
$this->see('test-itm'); //Check for the name
51-
$this->see('integration_test'); // Check for the type
50+
51+
//TODO: Check if the item exists in the db
52+
5253

5354

5455
//Get the ID of the Item
5556
$item_id = $this->get_item_id();
5657

5758

5859
//Visit the Edit page
59-
$this->press('Edit ' . $item_id);
60+
$this->visit('/webpanel/store/items/'.$item_id.'/edit')->see('Edit Item test-itm');
6061
$this->see("test-itm"); //Check for the name
6162
$this->see("integration_slot"); //Check for the loadout slot
6263

6364
//Make a Edit and Save
6465
$this->type('integration_test_2', 'type'); //Change the type
65-
$this->press('Edit Category');
66+
$this->press('Edit Item');
67+
68+
$this->visit('/webpanel/store/items/'.$item_id.'/edit')->see('Edit Item test-itm');
6669

6770
//Confirm the edit
6871
$this->see('integration_test_2'); //Verify the changed type
6972

73+
74+
//TODO: Add a remove and a remove+refund button so the item can be deleted from the edit menu
7075
//Delete the category
71-
$this->press('Remove ' . $item_id);
76+
//$this->press('Remove ' . $item_id);
7277

7378
//Confirm that its deleted
74-
$this->assertNull(StoreItem::where('name', 'test-itm')->first());
79+
//$this->assertNull(StoreItem::where('name', 'test-itm')->first());
7580
}
7681

7782

@@ -95,7 +100,7 @@ private function delete_item_if_exists()
95100

96101
private function create_category()
97102
{
98-
$category = StoreCategory::where('name', 'test-cat')->first();
103+
$category = StoreCategory::where('display_name', 'test-cat')->first();
99104

100105
if($category != null)
101106
{
@@ -113,6 +118,12 @@ private function create_category()
113118
$category->save();
114119
}
115120

121+
private function get_category_id()
122+
{
123+
$category = StoreCategory::where('display_name','test-cat')->first();
124+
return $category->id;
125+
}
126+
116127
private function login_with_admin_user()
117128
{
118129
$admin = User::where('name', 'admin')->first();

0 commit comments

Comments
 (0)