當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Opportunity::getCount方法代碼示例

本文整理匯總了PHP中Opportunity::getCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opportunity::getCount方法的具體用法?PHP Opportunity::getCount怎麽用?PHP Opportunity::getCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Opportunity的用法示例。


在下文中一共展示了Opportunity::getCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLoad

 public function testLoad()
 {
     $this->assertEquals(2, Group::getCount());
     $this->assertEquals(0, Role::getCount());
     $this->assertEquals(0, Account::getCount());
     $this->assertEquals(0, Contact::getCount());
     $this->assertEquals(0, Opportunity::getCount());
     $this->assertEquals(0, Meeting::getCount());
     $this->assertEquals(0, Note::getCount());
     $this->assertEquals(0, Task::getCount());
     $this->assertEquals(1, User::getCount());
     $this->assertEquals(0, ProductCatalog::getCount());
     $this->assertEquals(0, ProductCategory::getCount());
     $this->assertEquals(0, ProductTemplate::getCount());
     $this->assertEquals(0, Product::getCount());
     $messageLogger = new MessageLogger();
     DemoDataUtil::unsetLoadedModules();
     DemoDataUtil::load($messageLogger, 3);
     $this->assertEquals(8, Group::getCount());
     $this->assertEquals(3, Role::getCount());
     $this->assertEquals(3, Account::getCount());
     $this->assertEquals(16, Contact::getCount());
     $this->assertEquals(6, Opportunity::getCount());
     $this->assertEquals(18, Meeting::getCount());
     $this->assertEquals(12, Note::getCount());
     $this->assertEquals(9, Task::getCount());
     $this->assertEquals(10, User::getCount());
     $this->assertEquals(1, ProductCatalog::getCount());
     $this->assertEquals(6, ProductCategory::getCount());
     $this->assertEquals(32, ProductTemplate::getCount());
     $this->assertEquals(59, Product::getCount());
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:32,代碼來源:DemoDataUtilTest.php

示例2: testSuperUserConvertAction

 /**
  * @depends testSuperUserCreateAction
  */
 public function testSuperUserConvertAction()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     $startingLeadState = LeadsUtil::getStartingState();
     $startingContactState = ContactsUtil::getStartingState();
     $leads = Contact::getByName('myNewLead myNewLeadson');
     $this->assertEquals(1, count($leads));
     $lead = $leads[0];
     $this->assertTrue($lead->state == $startingLeadState);
     //Test just going to the convert page.
     $this->setGetArray(array('id' => $lead->id));
     $this->resetPostArray();
     //Test trying to convert by skipping account creation and by skipping opportunity creation
     $this->runControllerWithNoExceptionsAndGetContent('leads/default/convert');
     $this->setGetArray(array('id' => $lead->id));
     $this->setPostArray(array('AccountSkip' => 'Not Used'));
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convert');
     $this->setGetArray(array('id' => $lead->id));
     $this->setPostArray(array('OpportunitySkip' => 'Not Used'));
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convertFinal');
     $leadId = $lead->id;
     $lead->forget();
     $contact = Contact::getById($leadId);
     $this->assertTrue($contact->state == $startingContactState);
     //Test trying to convert by creating a new account and by skipping opportunity creation.
     $lead5 = LeadTestHelper::createLeadbyNameForOwner('superLead5', $super);
     $this->assertTrue($lead5->state == $startingLeadState);
     $this->setGetArray(array('id' => $lead5->id));
     $this->setPostArray(array('Account' => array('name' => 'someAccountName')));
     $this->assertEquals(0, Account::getCount());
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convert');
     $this->setGetArray(array('id' => $lead5->id));
     $this->setPostArray(array('OpportunitySkip' => 'Not Used'));
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convertFinal');
     $this->assertEquals(1, Account::getCount());
     $lead5Id = $lead5->id;
     $lead5->forget();
     $contact5 = Contact::getById($lead5Id);
     $this->assertTrue($contact5->state == $startingContactState);
     $this->assertEquals('someAccountName', $contact5->account->name);
     //Test trying to convert by selecting an existing account and by skipping opportunity creation.
     $account = AccountTestHelper::createAccountbyNameForOwner('someNewAccount', $super);
     $lead6 = LeadTestHelper::createLeadbyNameForOwner('superLead6', $super);
     $this->assertTrue($lead6->state == $startingLeadState);
     $this->setGetArray(array('id' => $lead6->id));
     $this->setPostArray(array('AccountSelectForm' => array('accountId' => $account->id, 'accountName' => 'someNewAccount')));
     $this->assertEquals(2, Account::getCount());
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convert');
     $this->setGetArray(array('id' => $lead6->id));
     $this->setPostArray(array('OpportunitySkip' => 'Not Used'));
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convertFinal');
     $this->assertEquals(2, Account::getCount());
     $lead6Id = $lead6->id;
     $lead6->forget();
     $contact6 = Contact::getById($lead6Id);
     $this->assertTrue($contact6->state == $startingContactState);
     $this->assertEquals($account, $contact6->account);
     //Test trying to convert by skipping account creation and by creating new opportunity
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convert');
     $leadOpp = LeadTestHelper::createLeadbyNameForOwner('superLeadOpp', $super);
     $this->setGetArray(array('id' => $leadOpp->id));
     $this->setPostArray(array('AccountSkip' => 'Not Used'));
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convert');
     $this->setGetArray(array('id' => $leadOpp->id));
     $this->setPostArray(array('Opportunity' => array('name' => 'someOpportunityName', 'amount' => array('currency' => array('id' => '1'), 'value' => '100'), 'closeDate' => '6/19/2014', 'stage' => array('value' => 'Negotiating'), 'probability' => '50')));
     $this->assertEquals(0, Opportunity::getCount());
     $this->assertEquals(2, Account::getCount());
     $this->runControllerWithRedirectExceptionAndGetContent('leads/default/convertFinal');
     $leadId = $leadOpp->id;
     $leadOpp->forget();
     $contact = Contact::getById($leadId);
     $this->assertTrue($contact->state == $startingContactState);
     $this->assertEquals(1, Opportunity::getCount());
     $this->assertEquals(2, Account::getCount());
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:78,代碼來源:LeadsSuperUserWalkthroughTest.php


注:本文中的Opportunity::getCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。