Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Reservation API #60

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: required
dist: trusty
group: edge
addons:
apt:
packages:
Expand Down Expand Up @@ -58,5 +59,6 @@ script:
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true

# The scripts for grunt/phpunit type tests
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Backend\Block\Widget\Grid\Container
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class UnreadMessagePopup extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/ToolbarEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @since 100.0.2
*/
class ToolbarEntry extends \Magento\Backend\Block\Template
{
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/AdminNotification/Block/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @api
* @since 100.0.2
*/
class Window extends \Magento\Backend\Block\Template
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
namespace Magento\AdminNotification\Controller\Adminhtml;

/**
* @api
* @since 100.0.2
*/
abstract class Notification extends \Magento\Backend\App\AbstractAction
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* AdminNotification update frequency source
*
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Frequency implements \Magento\Framework\Option\ArrayInterface
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
* @author Magento Core Team <core@magentocommerce.com>
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @api
* @since 100.0.2
*/
class Feed extends \Magento\Framework\Model\AbstractModel
{
Expand Down
5 changes: 2 additions & 3 deletions app/code/Magento/AdminNotification/Model/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/**
* AdminNotification Inbox model
*
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox _getResource()
* @method \Magento\AdminNotification\Model\ResourceModel\Inbox getResource()
* @method int getSeverity()
* @method \Magento\AdminNotification\Model\Inbox setSeverity(int $value)
* @method string getDateAdded()
Expand All @@ -29,7 +27,8 @@
* @method int getIsRemove()
* @method \Magento\AdminNotification\Model\Inbox setIsRemove(int $value)
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierInterface, InboxInterface
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/InboxInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* AdminNotification Inbox interface
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
interface InboxInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* Notification service model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class NotificationService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Grid;

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
namespace Magento\AdminNotification\Model\ResourceModel;

/**
* AdminNotification Inbox model
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Inbox extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*
* @api
* @author Magento Core Team <core@magentocommerce.com>
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;

/**
* @api
* @since 100.0.2
*/
class Critical extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\Inbox\Collection;

/**
* @api
* @since 100.0.2
*/
class Unread extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Collection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System;

/**
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System\Message;

/**
* @api
* @since 100.0.2
*/
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\ResourceModel\System\Message\Collection;

/**
* @api
* @since 100.0.2
*/
class Synchronized extends \Magento\AdminNotification\Model\ResourceModel\System\Message\Collection
{
/**
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/AdminNotification/Model/System/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

/**
* @codeCoverageIgnore
* @api
* @since 100.0.2
*/
class Message extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Magento\Store\Model\Store;

/**
* @deprecated
* @deprecated 100.1.0
*/
class Baseurl implements \Magento\Framework\Notification\MessageInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\System\Message;

/**
* @api
* @since 100.0.2
*/
class CacheOutdated implements \Magento\Framework\Notification\MessageInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\System\Message\Media;

/**
* @api
* @since 100.0.2
*/
abstract class AbstractSynchronization implements \Magento\Framework\Notification\MessageInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;

/**
* @api
* @since 100.0.2
*/
class Error extends \Magento\AdminNotification\Model\System\Message\Media\AbstractSynchronization
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
*/
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;

/**
* @api
* @since 100.0.2
*/
class Success extends \Magento\AdminNotification\Model\System\Message\Media\AbstractSynchronization
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

use Magento\Store\Model\Store;

/**
* @api
* @since 100.0.2
*/
class Security implements \Magento\Framework\Notification\MessageInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
namespace Magento\AdminNotification\Test\Unit\Block;

class ToolbarEntryTest extends \PHPUnit_Framework_TestCase
class ToolbarEntryTest extends \PHPUnit\Framework\TestCase
{
/**
* Retrieve toolbar entry block instance
Expand All @@ -21,12 +21,9 @@ protected function _getBlockInstance($unreadNotifications)
{
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
// mock collection of unread notifications
$notificationList = $this->getMock(
$notificationList = $this->createPartialMock(
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
['getSize', 'setCurPage', 'setPageSize'],
[],
'',
false
['getSize', 'setCurPage', 'setPageSize']
);
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));

Expand Down
37 changes: 11 additions & 26 deletions app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace Magento\AdminNotification\Test\Unit\Model;

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
use Magento\Framework\Config\ConfigOptionsListConstants;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FeedTest extends \PHPUnit_Framework_TestCase
class FeedTest extends \PHPUnit\Framework\TestCase
{
/** @var \Magento\AdminNotification\Model\Feed */
protected $feed;
Expand Down Expand Up @@ -52,42 +52,27 @@ class FeedTest extends \PHPUnit_Framework_TestCase

protected function setUp()
{
$this->inboxFactory = $this->getMock(
$this->inboxFactory = $this->createPartialMock(
\Magento\AdminNotification\Model\InboxFactory::class,
['create'],
[],
'',
false
);
$this->curlFactory = $this->getMock(
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
['create'],
[],
'',
false
['create']
);
$this->curlFactory = $this->createPartialMock(\Magento\Framework\HTTP\Adapter\CurlFactory::class, ['create']);
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
->disableOriginalConstructor()->getMock();
$this->appState = $this->getMock(\Magento\Framework\App\State::class, ['getInstallDate'], [], '', false);
$this->inboxModel = $this->getMock(
\Magento\AdminNotification\Model\Inbox::class,
[
$this->appState = $this->createPartialMock(\Magento\Framework\App\State::class, ['getInstallDate']);
$this->inboxModel = $this->createPartialMock(\Magento\AdminNotification\Model\Inbox::class, [
'__wakeup',
'parse'
],
[],
'',
false
);
$this->backendConfig = $this->getMock(
]);
$this->backendConfig = $this->createPartialMock(
\Magento\Backend\App\ConfigInterface::class,
[
'getValue',
'setValue',
'isSetFlag'
]
);
$this->cacheManager = $this->getMock(
$this->cacheManager = $this->createPartialMock(
\Magento\Framework\App\CacheInterface::class,
[
'load',
Expand All @@ -106,7 +91,7 @@ protected function setUp()
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
->disableOriginalConstructor()->getMock();

$this->urlBuilder = $this->getMock(\Magento\Framework\UrlInterface::class);
$this->urlBuilder = $this->createMock(\Magento\Framework\UrlInterface::class);

$this->feed = $this->objectManagerHelper->getObject(
\Magento\AdminNotification\Model\Feed::class,
Expand Down
Loading