当前位置: 首页>>代码示例>>PHP>>正文


PHP Object::getName方法代码示例

本文整理汇总了PHP中Object::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::getName方法的具体用法?PHP Object::getName怎么用?PHP Object::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Object的用法示例。


在下文中一共展示了Object::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_deactivateFail

 /**
  * Test a failing deactivate
  *
  * @return void
  * @author Dan Cox
  */
 public function test_deactivateFail()
 {
     $this->modules->shouldReceive('deactivate')->with('test')->andThrow("Exception");
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'test']);
     $this->assertContains('Failed to deactivate', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:13,代码来源:ModuleDeactivateTest.php

示例2: test_fail

 /**
  * Test a fail to make a config file for whatever reason
  *
  * @return void
  * @author Dan Cox
  */
 public function test_fail()
 {
     $this->setExpectedException('RuntimeException');
     $this->fs->shouldReceive('mkdir')->with(WORKBENCH . 'test')->andThrow(new Exception());
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'test']);
     $this->assertContains('Failed', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:14,代码来源:ModuleMakeTest.php

示例3: test_addFail

 /**
  * Test a fail case
  *
  * @return void
  * @author Dan Cox
  */
 public function test_addFail()
 {
     $this->database->shouldReceive('setModel')->with('Alice\\Entity\\Contact')->andReturn($this->database);
     $this->database->shouldReceive('getEntity')->andThrow('Exception');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'first' => 'test', 'last' => 'test', 'email' => 'test@test.com', '--phone' => '12345678910']);
     $this->assertContains('There was an issue', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:14,代码来源:ContactAddTest.php

示例4: test_invalidCron

 /**
  * Test when a cron cannot be found
  *
  * @return void
  * @author Dan Cox
  */
 public function test_invalidCron()
 {
     $this->setExpectedException('RuntimeException');
     $this->database->shouldReceive('setModel')->with('Alice\\Entity\\Cron')->andReturn($this->database);
     $this->database->shouldReceive('count')->andReturn(0);
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'test']);
 }
开发者ID:danzabar,项目名称:alice,代码行数:14,代码来源:CronRemoveTest.php

示例5: test_runThroughFailDoctrine

 /**
  * Test a run through that fails on dctrine
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runThroughFailDoctrine()
 {
     $this->DI->addMock('doctrineprocess', $this->doctrine);
     $this->doctrine->shouldReceive('build')->with(['force' => true])->andReturn($this->doctrine);
     $this->doctrine->shouldReceive('getProcess')->andReturn($this->doctrine);
     $this->doctrine->shouldReceive('mustRun')->andThrow('Exception');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName()]);
     $this->assertContains('Failed updating schema...', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:16,代码来源:UpdateTest.php

示例6: test_runThrough

 /**
  * Command is simple, lets just test a run through
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runThrough()
 {
     $this->DI->addMock('config', $this->config);
     $this->config->shouldReceive('create');
     $this->config->shouldReceive('params')->andReturn($this->config);
     $this->config->shouldReceive('save');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'test']);
     $this->assertContains("Saved project file", $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:16,代码来源:ProjectCreateTest.php

示例7: test_update

 /**
  * Basic test
  *
  * @return void
  * @author Dan Cox
  */
 public function test_update()
 {
     $this->cron->shouldReceive('updateFromDB');
     $this->process->shouldReceive('build')->andReturn($this->process);
     $this->process->shouldReceive('getProcess')->andReturn($this->process);
     $this->process->shouldReceive('mustRun');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName()]);
     $this->assertContains('Updated', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:16,代码来源:CronUpdateTest.php

示例8: test_failbyexception

 /**
  * Fail by exception
  *
  * @return void
  * @author Dan Cox
  */
 public function test_failbyexception()
 {
     $this->database->shouldReceive('setModel')->with('Alice\\Entity\\Contact')->andReturn($this->database);
     $this->database->shouldReceive('getEntity')->andReturn($this->database);
     $this->database->shouldReceive('count')->andReturn(1);
     $this->database->shouldReceive('first')->andThrow('Exception');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'email' => 'test@test.com']);
     $this->assertContains("Failed removing contact from database", $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:16,代码来源:ContactRemoveTest.php

示例9: test_runThrough

 /**
  * Test a run through with a mocked process
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runThrough()
 {
     $this->DI->addMock('doctrineprocess', $this->doctrine);
     $this->doctrine->shouldReceive('build')->with(['force' => true])->andReturn($this->doctrine);
     $this->doctrine->shouldReceive('getProcess')->andReturn($this->doctrine);
     $this->doctrine->shouldReceive('run');
     $this->doctrine->shouldReceive('isSuccessful')->andReturn(TRUE);
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName()]);
     $this->assertContains('Successfully updated the database schema', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:17,代码来源:DoctrineSchemaTest.php

示例10: test_runThroughCommand

 /**
  * Test a working run through of the command
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runThroughCommand()
 {
     $this->command->getHelper('question')->setInputStream($this->inputStream("git init, touch readme.md\nvalue = test, foo = bar\n"));
     // Database expectations
     $this->database->shouldReceive('getEntity')->andReturn($this->database);
     $this->database->shouldReceive('persist');
     $this->database->shouldReceive('flush');
     // Mock the config class
     $this->DI->addMock('config', $this->config);
     $this->config->shouldReceive('create')->with(CONFIG . 'commands/test.command.yml');
     $this->config->shouldReceive('params')->andReturn($this->config);
     $this->config->shouldReceive('save');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'test.command']);
 }
开发者ID:danzabar,项目名称:alice,代码行数:21,代码来源:CommandCreateTest.php

示例11: test_updateProjectsFromScan

 /**
  * Test updating existing projects
  *
  * @return void
  * @author Dan Cox
  */
 public function test_updateProjectsFromScan()
 {
     $this->DI->addMock('finder', $this->finder);
     $this->DI->addMock('config', $this->config);
     $this->DI->addMock('database', $this->database);
     $this->finder->shouldReceive('files')->andReturn($this->finder);
     $this->finder->shouldReceive('in')->andReturn([$this->finder]);
     $this->finder->shouldReceive('getRealPath')->andReturn('/var/www/test/test.yml');
     $this->config->shouldReceive('load')->with('/var/www/test/test.yml')->andReturn($this->config);
     $this->config->shouldReceive('params')->andReturn($this->config);
     $this->config->name = 'project';
     $this->config->description = '';
     $this->config->root_development = '';
     $this->config->root_live = '';
     $this->config->repository = array('remote_url' => '');
     $this->database->shouldReceive('getEntity')->andReturn($this->database);
     $this->database->shouldReceive('setModel');
     $this->database->shouldReceive('count')->with(['name', '=', 'project'])->andReturn(1);
     $this->database->shouldReceive('first')->andReturn($this->database);
     $this->database->repository = $this->database;
     $this->database->shouldReceive('save');
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName()]);
     $this->assertContains('Successfully saved project: project', $CT->getDisplay());
     $this->assertContains('Finished processing project file changes', $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:32,代码来源:ProjectScanTest.php

示例12: UserDataLog

 /**
  * Construtor
  * @param string $serviceName
  * @param Object $userData
  */
 function UserDataLog($serviceName, $userData)
 {
     $this->serviceName = $serviceName;
     $this->setDirectory();
     // Definindo dados do usuário
     $this->fields['ip'] = $userData->getIp();
     $this->fields['language'] = $userData->getLanguage();
     $this->fields['nameHost'] = $userData->getName();
     $this->fields['OS'] = $userData->getOS();
     $this->fields['port'] = $userData->getPort();
     $this->fields['resolution'] = $userData->getResolution();
     $this->fields['title'] = $userData->getTitle();
     $this->fields['url'] = $userData->getURL();
     $browser = array();
     $support = array();
     $browser = $userData->getBrowser();
     $support = $userData->getSupport();
     $i = 0;
     for ($i = 0; $i < count($browser) - 1; $i++) {
         $this->fields['browser'] .= $browser[$i] . " , ";
     }
     $this->fields['browser'] .= $browser[$i];
     for ($i = 0; $i < count($support) - 1; $i++) {
         $this->fields['support'] .= $support[$i] . " , ";
     }
     $this->fields['support'] .= $support[$i];
 }
开发者ID:Ethennoob,项目名称:Web,代码行数:32,代码来源:class.UserDataLog.php

示例13: test_runBasicSkeletonCommands

 /**
  * Using a test skeleton, run a basic skeleton command list
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runBasicSkeletonCommands()
 {
     $sp = m::mock('skeletonprocess');
     $collection = m::mock('collection');
     $this->DI->addMock('skeletonprocess', $sp);
     $this->DI->addMock('collection', $collection);
     $this->DI->addMock('fs', $this->filesystem);
     // Collection Mocks
     $collection->shouldReceive('create')->andReturn($collection);
     $collection->build_script = array('mkdir [directory]', 'composer install');
     // FS Mocks
     $this->filesystem->shouldReceive('exists')->andReturn(TRUE);
     // Skeleton Mocks
     $sp->shouldReceive('build')->with(['directory' => __DIR__, 'verbose' => false])->andReturn($sp);
     $sp->shouldReceive('getProcess')->andReturn($sp);
     $sp->shouldReceive('setArguments')->with(array('mkdir', __DIR__))->andReturn($sp);
     $sp->shouldReceive('setArguments')->with(array('composer', 'install'))->andReturn($sp);
     $sp->shouldReceive('mustRun');
     $sp->shouldReceive('getCommandLine')->andReturn("'mkdir' '" . __DIR__ . "'");
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'config' => 'test.yml', 'directory' => __DIR__]);
     // The skeleton process passes, but the composer process fails
     $this->assertContains("Successfully ran command: 'mkdir'", $CT->getDisplay());
     $this->assertContains("The command \"'composer'", $CT->getDisplay());
 }
开发者ID:danzabar,项目名称:alice,代码行数:31,代码来源:SkeletonBuildTest.php

示例14: test_runtimeExceptionOnMissingCommandList

 /**
  * Test that a run time exception fires when the command list does not exist
  *
  * @return void
  * @author Dan Cox
  */
 public function test_runtimeExceptionOnMissingCommandList()
 {
     $this->database->shouldReceive('setModel')->with('Alice\\Entity\\Command')->andReturn($this->database);
     $this->database->shouldReceive('getEntity')->andReturn($this->database);
     $this->database->shouldReceive('count')->andReturn(0);
     $this->setExpectedException('RuntimeException');
     $CT = new CommandTester($this->command);
     $CT->execute(["command" => $this->command->getName(), "name" => 'test', "time" => '* * * * *', "--commandlist" => 'test']);
 }
开发者ID:danzabar,项目名称:alice,代码行数:15,代码来源:CronCreateTest.php

示例15: test_commandDoesntExist

 /**
  * Test the runtime exception fires when a command does not exist
  *
  * @return void
  * @author Dan Cox
  */
 public function test_commandDoesntExist()
 {
     $this->setExpectedException('RuntimeException');
     $this->database->shouldReceive('setModel')->with('Alice\\Entity\\Command')->andReturn($this->database);
     $this->database->shouldReceive('getEntity')->andReturn($this->database);
     $this->database->shouldReceive('count')->andReturn(0);
     $CT = new CommandTester($this->command);
     $CT->execute(['command' => $this->command->getName(), 'name' => 'testFail', 'directory' => __DIR__]);
 }
开发者ID:danzabar,项目名称:alice,代码行数:15,代码来源:CommandRunTest.php


注:本文中的Object::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。