Skip to content

Commit

Permalink
https://github.com/pluf/shop/issues/4
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafabarmshory committed Mar 14, 2020
1 parent 20d4303 commit 1f7dc73
Show file tree
Hide file tree
Showing 54 changed files with 1,168 additions and 981 deletions.
409 changes: 409 additions & 0 deletions .buildpath

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Eclipse
#.buildpath
/.settings/
.phpunit.result.cache
.buildpath


# Examples
Expand Down
20 changes: 17 additions & 3 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.php.composer.core.builder.buildPathManagementBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<name>org.eclipse.php.composer.core.builder.buildPathManagementBuilder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -41,12 +46,21 @@
</natures>
<filteredResources>
<filter>
<id>1550942206749</id>
<id>1584123753104</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-location-matches-false-false-/*/build</arguments>
</matcher>
</filter>
<filter>
<id>1584123753108</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-vendor</arguments>
<arguments>1.0-name-matches-false-false-/*/vendor/*/*/vendor</arguments>
</matcher>
</filter>
</filteredResources>
Expand Down
97 changes: 87 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name" : "pluf/shop",
"version" : "6.0.5",
"description" : "Simple online shop and service",
"type" : "library",
"license" : "MIT",
Expand All @@ -21,19 +22,14 @@
],
"minimum-stability" : "stable",
"require" : {
"pluf/core" : "5.13.x",
"pluf/tenant" : "5.13.x",
"pluf/cache" : "5.13.x",
"pluf/cms" : "5.13.x",
"pluf/bank" : "5.13.x",
"pluf/monitor" : "5.13.x"
"pluf/core" : "6.x",
"pluf/tenant" : "6.x",
"pluf/bank" : "6.x",
"pluf/monitor" : "6.x"
},
"require-dev" : {
"pluf/test" : "5.13.x"
"pluf/test" : "6.x"
},
"include-path" : [
"src/"
],
"homepage" : "https://gitlab.com/microshop/shop",
"support" : {
"email" : "[email protected]",
Expand All @@ -46,5 +42,86 @@
"shop",
"sell",
"service"
],
"include-path" : [
"src/"
],
"autoload" : {
"psr-4" : {
"Pluf\\Shop\\" : "src6"
},
"psr-0" : {
"" : "src"
}
},
"autoload-dev" : {
"psr-4" : {
"Pluf\\Test\\" : "tests"
}
},
"repositories" : [{
"type" : "path",
"url" : "../core",
"name" : "pluf/core",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../test",
"name" : "pluf/test",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../http2",
"name" : "pluf/http2",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../user",
"name" : "pluf/user",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../workflow",
"name" : "pluf/workflow",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../discount",
"name" : "pluf/discount",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../bank",
"name" : "pluf/bank",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../monitor",
"name" : "pluf/monitor",
"options" : {
"symlink" : true
}
}, {
"type" : "path",
"url" : "../tenant",
"name" : "pluf/tenant",
"options" : {
"symlink" : true
}
}
]
}
46 changes: 20 additions & 26 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<phpunit
bootstrap="./vendor/autoload.php"
stopOnWarning="false"
verbose="false"
backupGlobals="false"
backupStaticAttributes="false"
colors="true">
<testsuites>
<testsuite name="Basic">
<directory>tests/Shop/</directory>
</testsuite>
<testsuite name="Product">
<directory>tests/Product/</directory>
</testsuite>
<testsuite name="Service">
<directory>tests/Service/</directory>
</testsuite>
<testsuite name="Category">
<directory>tests/Categories/</directory>
</testsuite>
<testsuite name="Delivery">
<directory>tests/Delivery/</directory>
</testsuite>
<testsuite name="Order">
<directory>tests/Order/</directory>
<directory>tests/OrderItem/</directory>
</testsuite>
<testsuite name="Shop">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<!-- Code coverage -->
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
<directory suffix=".php">./src6</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-html" target="build/tmp/report" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/tmp/coverage.xml"/>
<log type="junit" target="build/tmp/logfile.xml"/>
</logging>
</phpunit>
69 changes: 0 additions & 69 deletions run.php

This file was deleted.

15 changes: 3 additions & 12 deletions src/Shop/Agency.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Shop_Agency extends Shop_DetailedObject
{

/**
*
* @brief مدل داده‌ای را بارگذاری می‌کند.
*
* تمام فیلدهای مورد نیاز برای این مدل داده‌ای در این متد تعیین شده و به
Expand All @@ -23,7 +24,7 @@ function init()
$this->_a['table'] = 'shop_agency';
$this->_a['model'] = 'Shop_Agency';
$this->_model = 'Shop_Agency';

$this->_a['cols'] = array_merge($this->_a['cols'], array(
'province' => array(
'type' => 'Pluf_DB_Field_Varchar',
Expand Down Expand Up @@ -88,24 +89,14 @@ function init()
'relate_name' => 'agencies',
'editable' => true,
'readable' => true
),
'content_id' => array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'CMS_Content',
'name' => 'content',
'graphql_name' => 'content',
'relate_name' => 'agencies',
'is_null' => true,
'editable' => true,
'readable' => true
)
));
}

/**
* Checks if given user is a owner of zone
*
* @param User_Account $user
* @param User_Account $user
* @return boolean
*/
function isOwner($user)
Expand Down
13 changes: 2 additions & 11 deletions src/Shop/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ function init()
'relate_name' => 'children',
'editable' => true,
'readable' => true
),
'content_id' => array(
'type' => 'Pluf_DB_Field_Foreignkey',
'model' => 'CMS_Content',
'blank' => true,
'name' => 'content',
'graphql_name' => 'content',
'relate_name' => 'categories',
'editable' => true,
'readable' => true
)
);

Expand All @@ -94,7 +84,8 @@ function init()
/**
* \brief پیش ذخیره را انجام می‌دهد
*
* @param $create
* @param
* $create
*/
function preSave($create = false)
{
Expand Down
Loading

0 comments on commit 1f7dc73

Please sign in to comment.