Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertDeviceDataIsPresentInBraintreeRequest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertDeviceDataIsPresentInBraintreeRequest extends AbstractConstraint
16 {
20  const FILE_NAME = 'payment.log';
21 
25  const DEVICE_DATA_PATTERN = '/\'deviceData\' => \'{"device_session_id":"\w*","fraud_merchant_id":"\w*"}\'/';
26 
33  public function processAssert(Log $log)
34  {
35  $file = $log->getFileContent(self::FILE_NAME);
36  \PHPUnit\Framework\Assert::assertRegExp(
37  self::DEVICE_DATA_PATTERN,
38  $file,
39  'The device data is not present in Braintree request.'
40  );
41  }
42 
48  public function toString()
49  {
50  return 'The device data is present in Braintree request.';
51  }
52 }