Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24928606
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/app/Console/Commands/PhabricatorGetProjectsMap.php b/app/Console/Commands/PhabricatorProjectsMap.php
similarity index 95%
rename from app/Console/Commands/PhabricatorGetProjectsMap.php
rename to app/Console/Commands/PhabricatorProjectsMap.php
index 43fe15a..eb1b06a 100644
--- a/app/Console/Commands/PhabricatorGetProjectsMap.php
+++ b/app/Console/Commands/PhabricatorProjectsMap.php
@@ -1,50 +1,50 @@
<?php
namespace Nasqueron\Notifications\Console\Commands;
use Illuminate\Console\Command;
use ProjectsMap;
use Services;
-class PhabricatorGetProjectsMap extends Command {
+class PhabricatorProjectsMap extends Command {
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'phabricator:projectsmap';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Regenerate the projects map for each Phabricator instances';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct() {
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle() {
foreach (Services::getForGate('Phabricator') as $service) {
$this->info("Querying projects map for " . $service->instance);
$map = ProjectsMap::fetch($service->instance);
$map->saveToCache();
$this->table(
['PHID', 'Project name'],
$map->toArray()
);
}
}
}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 57dcdba..0387075 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -1,32 +1,32 @@
<?php
namespace Nasqueron\Notifications\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\Nasqueron\Notifications\Console\Commands\ConfigShow::class,
\Nasqueron\Notifications\Console\Commands\Inspire::class,
- \Nasqueron\Notifications\Console\Commands\PhabricatorGetProjectsMap::class,
+ \Nasqueron\Notifications\Console\Commands\PhabricatorProjectsMap::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();
}
}
diff --git a/tests/Console/Commands/PhabricatorGetProjectsMapTest.php b/tests/Console/Commands/PhabricatorProjectsMapTest.php
similarity index 90%
rename from tests/Console/Commands/PhabricatorGetProjectsMapTest.php
rename to tests/Console/Commands/PhabricatorProjectsMapTest.php
index c219e09..b3fdefd 100644
--- a/tests/Console/Commands/PhabricatorGetProjectsMapTest.php
+++ b/tests/Console/Commands/PhabricatorProjectsMapTest.php
@@ -1,31 +1,31 @@
<?php
namespace Nasqueron\Notifications\Tests\Console\Commands;
use Nasqueron\Notifications\Services\Service;
-class PhabricatorGetProjectsMapTest extends TestCase {
+class PhabricatorProjectsMapTest extends TestCase {
/**
* @var string
*/
- protected $class = 'Nasqueron\Notifications\Console\Commands\PhabricatorGetProjectsMap';
+ protected $class = 'Nasqueron\Notifications\Console\Commands\PhabricatorProjectsMap';
public function setUp () {
parent::setUp();
$service = $this->mockService('Phabricator');
$this->mockServices()
->shouldReceive('getForGate')
->once()
->andReturn([$service]);
$this->mockPhabricatorAPIForProjectsMap();
}
public function testRegularExecute () {
$this->tester->execute(['command' => $this->command->getName()]);
$this->assertRegexp('/PHID.*Project name/', $this->tester->getDisplay());
$this->assertRegexp('/PHID-PROJ-cztcgpvqr6smnnekotq7.*Agora/', $this->tester->getDisplay());
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Mar 21, 06:18 (15 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3546531
Default Alt Text
(4 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment