public function test_getRepresentativeCustomerId_notFound() { /** === Test Data === */ $EMAIL = Module::CUSTOMER_REPRESENTATIVE_EMAIL; $CUST_ID = '12'; /** === Setup Mocks === */ // $where = self::ATTR_CUST_EMAIL . '=' . $this->_conn->quote(self::CUSTOMER_REPRESENTATIVE_EMAIL); $this->mConn->shouldReceive('quote')->with($EMAIL)->andReturn("'{$EMAIL}'"); // $data = $this->_repoCore->getEntities(Cfg::ENTITY_MAGE_CUSTOMER, Cfg::E_CUSTOMER_A_ENTITY_ID, $where); $this->mRepoGeneric->shouldReceive('getEntities')->andReturn([]); // $id = $this->_repoCore->addEntity(Cfg::ENTITY_MAGE_CUSTOMER, $bind); $this->mRepoGeneric->shouldReceive('addEntity')->andReturn($CUST_ID); /** === Call and asserts === */ $data = $this->repo->getRepresentativeCustomerId(); $this->assertEquals($CUST_ID, $data); }
public function test_getRepresentative() { $data = $this->_obj->getRepresentativeCustomerId(); $this->assertTrue($data > 0); }