I have created a file under \Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList\Toolbar.php
namespace Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList;
class Toolbar extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
// we want this to be a real Magento 2 object
// complete with all it's dependencies
// so we use the object manager to get it
$this->block = $objectManager
->getObject('Vendor\Module\Test\Unit\Block\Catalog\Product\ProductList\Toolbar');
}
public function testgetAvailableOrders()
{ .... }
}
My phpunit.xml
is
<testsuite name="Magento Unit Tests">
<directory suffix="Test.php">../../../app/code/Vendor\Module /Test/Unit</directory>
Under magento 2 root, i ran
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml app/code/Vendor\Module/Test/Unit/
I get "No tests executed"
Tglssearch /Test
?