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


PHP Money::MXN方法代码示例

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


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

示例1: JsonSerializer

 /** @test */
 function it_should_serialize_a_domain_event_to_json()
 {
     $serializer = new JsonSerializer();
     $anEvent = new InstantaneousEvent(Identifier::fromString('abc'), Money::MXN(10000), new DateTime('2015-10-24 12:39:51'));
     $json = $serializer->serialize($anEvent);
     $this->assertEquals('{"occurred_on":"2015-10-24 12:39:51","member_id":"abc","amount":10000}', $json, 'JSON format for serialized event is incorrect');
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:8,代码来源:JsonSerializerTest.php

示例2:

 /** @test */
 function it_should_update_the_information_of_a_registered_member()
 {
     $member = $this->members->with(Identifier::fromString('wxyz'));
     $member->transfer(Money::MXN(500), $this->existingMember);
     $this->members->update($this->existingMember);
     $this->assertBalanceAmounts(3500, $this->existingMember, "Current member balance should be 3500");
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:8,代码来源:MembersTest.php

示例3: __construct

 /**
  * @param string $fromMemberId
  * @param string $amount
  * @param string $toMemberId
  * @param string $occurredOn
  */
 public function __construct($fromMemberId, $amount, $toMemberId, $occurredOn)
 {
     $this->occurredOn = DateTime::createFromFormat('Y-m-d H:i:s', $occurredOn);
     $this->fromMemberId = Identifier::fromString($fromMemberId);
     $this->amount = Money::MXN($amount);
     $this->toMemberId = Identifier::fromString($toMemberId);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:13,代码来源:TransferFundsNotification.php

示例4:

 /** @test */
 function beneficiary_balance_should_increase_after_funds_have_been_transferred()
 {
     $this->forAll(Generator\int(1, 10000))->then(function ($amount) {
         $fromMember = A::member()->withBalance(10000)->build();
         $toMember = A::member()->withBalance(5000)->build();
         $fromMember->transfer(Money::MXN($amount), $toMember);
         $this->assertBalanceIsGreaterThan(5000, $toMember, "Transferring {$amount} increased balance of receiver member");
     });
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:10,代码来源:MemberTest.php

示例5: InMemory

 /** @test */
 function it_should_send_deposit_received_email()
 {
     $template = Mockery::mock(TemplateEngine::class);
     $template->shouldReceive('render')->once()->with(Mockery::type('string'), Mockery::type('array'));
     $transport = new InMemory();
     $sender = new TransferFundsZendMailSender($template, $transport);
     $sender->sendDepositReceivedEmail(A::member()->build()->information(), A::member()->withEmail('montealegreluis@gmail.com')->build()->information(), Money::MXN(500), new DateTime());
     $this->assertEquals('montealegreluis@gmail.com', $transport->getLastMessage()->getTo()->current()->getEmail(), 'Address doesn\'t belong to the member receiving the deposit');
     $this->assertRegExp('/received.*deposit/', $transport->getLastMessage()->getSubject(), 'Email\'s subject is wrong');
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:11,代码来源:TransferFundsZendMailSenderTest.php

示例6: InstantaneousEvent

 /** @test */
 function it_should_create_an_stored_event_from_a_given_domain_event()
 {
     $event = new InstantaneousEvent(Identifier::fromString('abc'), Money::MXN(500000), new DateTime('2015-10-25 19:59:00'));
     $factory = new StoredEventFactory(new JsonSerializer());
     $storedEvent = $factory->from($event);
     // Stored events get an ID after being persisted
     $this->assertEquals(null, $storedEvent->id());
     $this->assertEquals('{"occurred_on":"2015-10-25 19:59:00","member_id":"abc","amount":500000}', $storedEvent->body());
     $this->assertEquals(InstantaneousEvent::class, $storedEvent->type());
     $this->assertEquals('2015-10-25 19:59:00', $storedEvent->occurredOn()->format('Y-m-d H:i:s'));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:12,代码来源:StoredEventFactoryTest.php

示例7: reset

 protected function reset()
 {
     $this->name = $this->faker->name;
     $this->email = $this->faker->email;
     $this->amount = Money::MXN($this->faker->numberBetween(0, 10000));
     $this->id = $this->faker->uuid;
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:7,代码来源:MembersBuilder.php

示例8: PersistEventsSubscriber

 /** @test */
 function it_should_subscribe_to_all_event_types()
 {
     $subscriber = new PersistEventsSubscriber(Mockery::mock(EventStore::class), Mockery::mock(StoredEventFactory::class));
     $this->assertTrue($subscriber->isSubscribedTo(new InstantaneousEvent(Identifier::any(), Money::MXN(100000), new DateTime('now'))));
     $this->assertTrue($subscriber->isSubscribedTo(A::transferWasMadeEvent()->build()));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:7,代码来源:PersistEventsSubscriberTest.php

示例9:

 function it_should_not_allow_withdrawing_more_than_the_current_balance()
 {
     $this->beConstructedThrough('withBalance', [Money::MXN(3000)]);
     $this->shouldThrow(InsufficientFunds::class)->duringWithdraw(Money::MXN(3500));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:5,代码来源:AccountSpec.php

示例10:

 /** @test */
 function it_should_format_a_money_object_information()
 {
     $this->assertEquals('$5,987.29 MXN', $this->formatter->formatMoney(Money::MXN(598729)));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:5,代码来源:MemberFormatterTest.php

示例11: build

 /**
  * @return TransferWasMade
  */
 public function build()
 {
     $event = new TransferWasMade(Identifier::fromString($this->fromId), Money::MXN($this->amount), Identifier::fromString($this->toId));
     $this->reset();
     return $event;
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:9,代码来源:TransferWasMadeBuilder.php

示例12:

 function it_should_record_that_a_transfer_was_made()
 {
     $this->transfer(Money::MXN(500), A::member()->build());
     $this->events()->count()->shouldBe(1);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:5,代码来源:MemberSpec.php

示例13: __construct

 /**
  * @param array $filteredInput
  */
 private function __construct(array $filteredInput)
 {
     $this->fromMemberId = Identifier::fromString($filteredInput['fromMemberId']);
     $this->toMemberId = Identifier::fromString($filteredInput['toMemberId']);
     $this->amount = Money::MXN((int) ($filteredInput['amount'] * 100));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:9,代码来源:TransferFundsRequest.php

示例14: isBalanceAmountGreaterThan

 /**
  * @param integer $lowerLimit
  * @return AmountLowerThanConstraint
  */
 public static function isBalanceAmountGreaterThan($lowerLimit)
 {
     return new AmountGreaterThanConstraint(Money::MXN((int) $lowerLimit));
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:8,代码来源:ProvidesMoneyConstraints.php

示例15:

 /** @test */
 function it_should_delegate_formatting_a_money_object()
 {
     $this->extension->formatMoney($amount = Money::MXN(300000));
     $this->formatter->shouldHaveReceived('formatMoney')->once()->with($amount);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:6,代码来源:EwalletExtensionTest.php


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