PHPToolKit/tests/Unit/Verification/LinkTest.php

393 lines
157 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SkillDisplay\PHPToolKit\Tests\Unit\Verification;
use Prophecy\PhpUnit\ProphecyTrait;
use SkillDisplay\PHPToolKit\Configuration\Settings;
use SkillDisplay\PHPToolKit\Verification\Link;
use PHPUnit\Framework\TestCase;
/**
* @covers SkillDisplay\PHPToolKit\Verification\Link
*/
class LinkTest extends TestCase
{
use ProphecyTrait;
/**
* @test
*/
public function instanceCanBeCreated()
{
$settings = $this->prophesize(Settings::class);
$subject = new Link(
$settings->reveal(),
10
);
static::assertInstanceOf(Link::class, $subject);
}
/**
* @test
*/
public function instanceCanBeCreatedWithoutSkillId()
{
$settings = $this->prophesize(Settings::class);
$subject = new Link($settings->reveal());
static::assertInstanceOf(Link::class, $subject);
}
/**
* @test
*/
public function canReturnSkillVerificationLinkForEducationalWithCampaign()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skill/10/0/2/678',
$subject->getVerificationLink('education', null, Link::SKILL, 678)
);
}
/**
* @test
*/
public function canReturnSkillVerificationLinkForBusiness()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skill/10/0/4',
$subject->getVerificationLink('business')
);
}
/**
* @test
*/
public function canReturnSkillVerificationLinkForCertification()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skill/10/0/1',
$subject->getVerificationLink('certification')
);
}
/**
* @test
*/
public function canReturnSkillVerificationLinkForSelf()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skill/10/0/3',
$subject->getVerificationLink('self')
);
}
/**
* @test
*/
public function canReturnSkillVerificationButtonForEducational()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skill/10/0/2" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#4A89C4"/>',
' <path d="M68.469 29.894L68.462 31H62.281V20.969H68.462V22.075H63.639V25.407H67.545V26.471H63.639V29.894H68.469ZM74.3863 25.596C74.153 25.2833 73.901 25.0663 73.6303 24.945C73.3596 24.819 73.0563 24.756 72.7203 24.756C72.0623 24.756 71.556 24.9917 71.2013 25.463C70.8466 25.9343 70.6693 26.6063 70.6693 27.479C70.6693 27.941 70.709 28.3377 70.7883 28.669C70.8676 28.9957 70.9843 29.2663 71.1383 29.481C71.2923 29.691 71.4813 29.845 71.7053 29.943C71.9293 30.041 72.1836 30.09 72.4683 30.09C72.879 30.09 73.236 29.9967 73.5393 29.81C73.8473 29.6233 74.1296 29.3597 74.3863 29.019V25.596ZM75.6323 20.689V31H74.8903C74.713 31 74.601 30.9137 74.5543 30.741L74.4423 29.88C74.139 30.244 73.7936 30.538 73.4063 30.762C73.019 30.986 72.571 31.098 72.0623 31.098C71.6563 31.098 71.2876 31.021 70.9563 30.867C70.625 30.7083 70.3426 30.4773 70.1093 30.174C69.876 29.8707 69.6963 29.4927 69.5703 29.04C69.4443 28.5873 69.3813 28.067 69.3813 27.479C69.3813 26.9563 69.4513 26.471 69.5913 26.023C69.7313 25.5703 69.932 25.1783 70.1933 24.847C70.4546 24.5157 70.7743 24.2567 71.1523 24.07C71.535 23.8787 71.9643 23.783 72.4403 23.783C72.8743 23.783 73.2453 23.8577 73.5533 24.007C73.866 24.1517 74.1436 24.3547 74.3863 24.616V20.689H75.6323ZM83.4313 23.909V31H82.6893C82.5119 31 82.3999 30.9137 82.3533 30.741L82.2553 29.978C81.9473 30.3187 81.6019 30.594 81.2193 30.804C80.8366 31.0093 80.3979 31.112 79.9033 31.112C79.5159 31.112 79.1729 31.049 78.8743 30.923C78.5803 30.7923 78.3329 30.6103 78.1323 30.377C77.9316 30.1437 77.7799 29.8613 77.6773 29.53C77.5793 29.1987 77.5303 28.8323 77.5303 28.431V23.909H78.7763V28.431C78.7763 28.9677 78.8976 29.383 79.1403 29.677C79.3876 29.971 79.7633 30.118 80.2673 30.118C80.6359 30.118 80.9789 30.0317 81.2963 29.859C81.6183 29.6817 81.9146 29.439 82.1853 29.131V23.909H83.4313ZM90.3419 25.169C90.3046 25.2203 90.2673 25.26 90.2299 25.288C90.1926 25.316 90.1413 25.33 90.0759 25.33C90.0059 25.33 89.9289 25.302 89.8449 25.246C89.7609 25.1853 89.6559 25.12 89.5299 25.05C89.4086 24.98 89.2569 24.917 89.0749 24.861C88.8976 24.8003 88.6783 24.77 88.4169 24.77C88.0669 24.77 87.7589 24.833 87.4929 24.959C87.2269 25.0803 87.0029 25.2577 86.8209 25.491C86.6436 25.7243 86.5083 26.0067 86.4149 26.338C86.3263 26.6693 86.2819 27.0403 86.2819 27.451C86.2819 27.8803 86.3309 28.263 86.4289 28.599C86.5269 28.9303 86.6646 29.2103 86.8419 29.439C87.0239 29.663 87.2409 29.8357 87.4929 29.957C87.7496 30.0737 88.0366 30.132 88.3539 30.132C88.6573 30.132 88.9069 30.097 89.1029 30.027C89.2989 29.9523 89.4599 29.8707 89.5859 29.782C89.7166 29.6933 89.8239 29.614 89.9079 29.544C89.9966 29.4693 90.0829 29.432 90.1669 29.432C90.2696 29.432 90.3489 29.4717 90.4049 29.551L90.7549 30.006C90.6009 30.1973 90.4259 30.3607 90.2299 30.496C90.0339 30.6313 89.8216 30.7457 89.5929 30.839C89.3689 30.9277 89.1333 30.993 88.8859 31.035C88.6386 31.077 88.3866 31.098 88.1299 31.098C87.6866 31.098 87.2736 31.0163 86.8909 30.853C86.5129 30.6897 86.1839 30.454 85.9039 30.146C85.6239 29.8333 85.4046 29.4507 85.2459 28.998C85.0873 28.5453 85.0079 28.0297 85.0079 27.451C85.0079 26.9237 85.0803 26.436 85.2249 25.988C85.3743 25.54 85.5889 25.155 85.8689 24.833C86.1536 24.5063 86.5013 24.252 86.9119 24.07C87.3273 23.888 87.8033 23.797 88.3399 23.797C88.8393 23.797 89.2779 23.8787 89.6559 24.042C90.0386 24.2007 90.3769 24.427 90.6709 24.721L90.3419 25.169ZM95.9355 27.808C95.3615 27.8267 94.8715 27.8733 94.4655 27.948C94.0641 28.018 93.7351 28.1113 93.4785 28.228C93.2265 28.3447 93.0421 28.4823 92.9255 28.641C92.8135 28.7997 92.7575 28.977 92.7575 29.173C92.7575 29.3597 92.7878 29.5207 92.8485 29.656C92.9091 29.7913 92.9908 29.9033 93.0935 29.992C93.2008 30.076 93.3245 30.139 93.4645 30.181C93.6091 30.2183 93.7631 30.237 93.9265 30.237C94.1458 30.237 94.3465 30.216 94.5285 30.174C94.7105 30.1273 94.8808 30.062 95.0395 29.978C95.2028 29.894 95.3568 29.7937 95.5015 29.677C95.6508 29.5603 95.7955 29.4273 95.9355 29.278V27.808ZM91.9105 24.91C92.3025 24.532 92.7248 24.2497 93.1775 24.063C93.6301 23.8763 94.1318 23.783 94.6825 23.783C95.0791 23.783 95.4315 23.
' <circle cx="25" cy="25" r="12" fill="#4A89C4" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('education')
);
}
/**
* @test
*/
public function canReturnSkillVerificationButtonForBusiness()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skill/10/0/4" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M65.802 29.922C66.1893 29.922 66.523 29.8777 66.803 29.789C67.083 29.7003 67.3117 29.5767 67.489 29.418C67.671 29.2547 67.804 29.0633 67.888 28.844C67.972 28.62 68.014 28.375 68.014 28.109C68.014 27.591 67.8297 27.1827 67.461 26.884C67.0923 26.5807 66.5393 26.429 65.802 26.429H63.632V29.922H65.802ZM63.632 22.04V25.463H65.424C65.8067 25.463 66.138 25.421 66.418 25.337C66.7027 25.253 66.936 25.1363 67.118 24.987C67.3047 24.8377 67.4423 24.658 67.531 24.448C67.6197 24.2333 67.664 24 67.664 23.748C67.664 23.1553 67.4867 22.7237 67.132 22.453C66.7773 22.1777 66.2267 22.04 65.48 22.04H63.632ZM65.48 20.969C66.096 20.969 66.6257 21.0297 67.069 21.151C67.517 21.2723 67.8833 21.445 68.168 21.669C68.4573 21.893 68.6697 22.1683 68.805 22.495C68.9403 22.817 69.008 23.181 69.008 23.587C69.008 23.8343 68.9683 24.0723 68.889 24.301C68.8143 24.525 68.7 24.735 68.546 24.931C68.392 25.127 68.196 25.3043 67.958 25.463C67.7247 25.617 67.4493 25.743 67.132 25.841C67.8693 25.981 68.4223 26.2447 68.791 26.632C69.1643 27.0147 69.351 27.5187 69.351 28.144C69.351 28.5687 69.2717 28.956 69.113 29.306C68.959 29.656 68.7303 29.957 68.427 30.209C68.1283 30.461 67.7597 30.657 67.321 30.797C66.8823 30.9323 66.383 31 65.823 31H62.281V20.969H65.48ZM76.7184 23.909V31H75.9764C75.7991 31 75.6871 30.9137 75.6404 30.741L75.5424 29.978C75.2344 30.3187 74.8891 30.594 74.5064 30.804C74.1237 31.0093 73.6851 31.112 73.1904 31.112C72.8031 31.112 72.4601 31.049 72.1614 30.923C71.8674 30.7923 71.6201 30.6103 71.4194 30.377C71.2187 30.1437 71.0671 29.8613 70.9644 29.53C70.8664 29.1987 70.8174 28.8323 70.8174 28.431V23.909H72.0634V28.431C72.0634 28.9677 72.1847 29.383 72.4274 29.677C72.6747 29.971 73.0504 30.118 73.5544 30.118C73.9231 30.118 74.2661 30.0317 74.5834 29.859C74.9054 29.6817 75.2017 29.439 75.4724 29.131V23.909H76.7184ZM82.824 25.078C82.768 25.1807 82.6817 25.232 82.565 25.232C82.495 25.232 82.4157 25.2063 82.327 25.155C82.2384 25.1037 82.1287 25.0477 81.998 24.987C81.872 24.9217 81.7204 24.8633 81.543 24.812C81.3657 24.756 81.1557 24.728 80.913 24.728C80.703 24.728 80.514 24.756 80.346 24.812C80.178 24.8633 80.0334 24.9357 79.912 25.029C79.7954 25.1223 79.7044 25.232 79.639 25.358C79.5784 25.4793 79.548 25.6123 79.548 25.757C79.548 25.939 79.5994 26.0907 79.702 26.212C79.8094 26.3333 79.9494 26.4383 80.122 26.527C80.2947 26.6157 80.4907 26.695 80.71 26.765C80.9294 26.8303 81.1534 26.9027 81.382 26.982C81.6154 27.0567 81.8417 27.1407 82.061 27.234C82.2804 27.3273 82.4764 27.444 82.649 27.584C82.8217 27.724 82.9594 27.8967 83.062 28.102C83.1694 28.3027 83.223 28.5453 83.223 28.83C83.223 29.1567 83.1647 29.46 83.048 29.74C82.9314 30.0153 82.7587 30.2557 82.53 30.461C82.3014 30.6617 82.0214 30.8203 81.69 30.937C81.3587 31.0537 80.976 31.112 80.542 31.112C80.0474 31.112 79.5994 31.0327 79.198 30.874C78.7967 30.7107 78.456 30.503 78.176 30.251L78.47 29.775C78.5074 29.7143 78.5517 29.6677 78.603 29.635C78.6544 29.6023 78.7197 29.586 78.799 29.586C78.883 29.586 78.9717 29.6187 79.065 29.684C79.1584 29.7493 79.2704 29.8217 79.401 29.901C79.5364 29.9803 79.6997 30.0527 79.891 30.118C80.0824 30.1833 80.3204 30.216 80.605 30.216C80.8477 30.216 81.06 30.1857 81.242 30.125C81.424 30.0597 81.5757 29.9733 81.697 29.866C81.8184 29.7587 81.907 29.635 81.963 29.495C82.0237 29.355 82.054 29.2057 82.054 29.047C82.054 28.851 82.0004 28.69 81.893 28.564C81.7904 28.4333 81.6527 28.3237 81.48 28.235C81.3074 28.1417 81.109 28.0623 80.885 27.997C80.6657 27.927 80.4394 27.8547 80.206 27.78C79.9774 27.7053 79.751 27.6213 79.527 27.528C79.3077 27.43 79.1117 27.3087 78.939 27.164C78.7664 27.0193 78.6264 26.842 78.519 26.632C78.4164 26.4173 78.365 26.1583 78.365 25.855C78.365 25.5843 78.421 25.3253 78.533 25.078C78.645 24.826 78.8084 24.6067 79.023 24.42C79.2377 24.2287 79.5014 24.077 79.814 23.965C80.1267 23.853 80.4837 23.797 80.885 23.797C81.3517 23.797 81.7694 23.8717 82.138 24.021C82.5114 24.1657 82.8334 24.3663 83.104 24.623L82.824 25.078ZM86.0667 23.909V31H84.8207V23.909H86.0667ZM86.3327 21.683C86.3327 21.8043 86.307 21.9187 86.2557 22.026C86.209
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#F7BF5D"/>',
' <circle cx="25" cy="25" r="12" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('business')
);
}
/**
* @test
*/
public function canReturnSkillVerificationButtonForCertification()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skill/10/0/1" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M69.323 28.928C69.3977 28.928 69.463 28.9583 69.519 29.019L70.058 29.6C69.6473 30.076 69.148 30.447 68.56 30.713C67.9767 30.979 67.2697 31.112 66.439 31.112C65.7203 31.112 65.067 30.9883 64.479 30.741C63.891 30.489 63.3893 30.139 62.974 29.691C62.5587 29.2383 62.2367 28.697 62.008 28.067C61.7793 27.437 61.665 26.744 61.665 25.988C61.665 25.232 61.784 24.539 62.022 23.909C62.26 23.279 62.5937 22.7377 63.023 22.285C63.457 21.8323 63.975 21.4823 64.577 21.235C65.179 20.983 65.844 20.857 66.572 20.857C67.286 20.857 67.916 20.9713 68.462 21.2C69.008 21.4287 69.4887 21.739 69.904 22.131L69.456 22.754C69.428 22.8007 69.3907 22.8403 69.344 22.873C69.302 22.901 69.2437 22.915 69.169 22.915C69.085 22.915 68.9823 22.8707 68.861 22.782C68.7397 22.6887 68.581 22.586 68.385 22.474C68.189 22.362 67.944 22.2617 67.65 22.173C67.356 22.0797 66.9943 22.033 66.565 22.033C66.047 22.033 65.5733 22.124 65.144 22.306C64.7147 22.4833 64.3437 22.7423 64.031 23.083C63.723 23.4237 63.4827 23.839 63.31 24.329C63.1373 24.819 63.051 25.372 63.051 25.988C63.051 26.6133 63.1397 27.171 63.317 27.661C63.499 28.151 63.744 28.5663 64.052 28.907C64.3647 29.243 64.731 29.4997 65.151 29.677C65.5757 29.8543 66.033 29.943 66.523 29.943C66.8217 29.943 67.09 29.9267 67.328 29.894C67.5707 29.8567 67.7923 29.8007 67.993 29.726C68.1983 29.6513 68.3873 29.558 68.56 29.446C68.7373 29.3293 68.9123 29.1917 69.085 29.033C69.1643 28.963 69.2437 28.928 69.323 28.928ZM75.9478 26.681C75.9478 26.3917 75.9058 26.128 75.8218 25.89C75.7425 25.6473 75.6235 25.4397 75.4648 25.267C75.3108 25.0897 75.1218 24.9543 74.8978 24.861C74.6738 24.763 74.4195 24.714 74.1348 24.714C73.5375 24.714 73.0638 24.889 72.7138 25.239C72.3685 25.5843 72.1538 26.065 72.0698 26.681H75.9478ZM76.9558 30.006C76.8018 30.1927 76.6175 30.356 76.4028 30.496C76.1882 30.6313 75.9572 30.7433 75.7098 30.832C75.4672 30.9207 75.2152 30.986 74.9538 31.028C74.6925 31.0747 74.4335 31.098 74.1768 31.098C73.6868 31.098 73.2342 31.0163 72.8188 30.853C72.4082 30.685 72.0512 30.4423 71.7478 30.125C71.4492 29.803 71.2158 29.4063 71.0478 28.935C70.8798 28.4637 70.7958 27.9223 70.7958 27.311C70.7958 26.8163 70.8705 26.3543 71.0198 25.925C71.1738 25.4957 71.3932 25.1247 71.6778 24.812C71.9625 24.4947 72.3102 24.2473 72.7208 24.07C73.1315 23.888 73.5935 23.797 74.1068 23.797C74.5315 23.797 74.9235 23.8693 75.2828 24.014C75.6468 24.154 75.9595 24.3593 76.2208 24.63C76.4868 24.896 76.6945 25.2273 76.8438 25.624C76.9932 26.016 77.0678 26.464 77.0678 26.968C77.0678 27.164 77.0468 27.2947 77.0048 27.36C76.9628 27.4253 76.8835 27.458 76.7668 27.458H72.0278C72.0418 27.906 72.1025 28.2957 72.2098 28.627C72.3218 28.9583 72.4758 29.236 72.6718 29.46C72.8678 29.6793 73.1012 29.845 73.3718 29.957C73.6425 30.0643 73.9458 30.118 74.2818 30.118C74.5945 30.118 74.8628 30.083 75.0868 30.013C75.3155 29.9383 75.5115 29.859 75.6748 29.775C75.8382 29.691 75.9735 29.614 76.0808 29.544C76.1928 29.4693 76.2885 29.432 76.3678 29.432C76.4705 29.432 76.5498 29.4717 76.6058 29.551L76.9558 30.006ZM79.7813 25.33C80.0053 24.8447 80.2807 24.4667 80.6073 24.196C80.934 23.9207 81.333 23.783 81.8043 23.783C81.9537 23.783 82.096 23.7993 82.2313 23.832C82.3713 23.8647 82.495 23.916 82.6023 23.986L82.5113 24.917C82.4833 25.0337 82.4133 25.092 82.3013 25.092C82.236 25.092 82.1403 25.078 82.0143 25.05C81.8883 25.022 81.746 25.008 81.5873 25.008C81.3633 25.008 81.1627 25.0407 80.9853 25.106C80.8127 25.1713 80.6563 25.2693 80.5163 25.4C80.381 25.526 80.2573 25.6847 80.1453 25.876C80.038 26.0627 79.94 26.2773 79.8513 26.52V31H78.5983V23.909H79.3123C79.4477 23.909 79.541 23.9347 79.5923 23.986C79.6437 24.0373 79.6787 24.126 79.6973 24.252L79.7813 25.33ZM90.2779 31H89.0319V24.952H85.3779V29.208C85.3779 29.5067 85.4503 29.7283 85.5949 29.873C85.7396 30.0177 85.9263 30.09 86.1549 30.09C86.2856 30.09 86.3976 30.0737 86.4909 30.041C86.5889 30.0037 86.6729 29.964 86.7429 29.922C86.8129 29.88 86.8713 29.8427 86.9179 29.81C86.9693 29.7727 87.0136 29.754 87.0509 29.754C87.1163 29.754 87.1746 29.7937 87.2259 29.873L87.5899 30.468C87.3753 30.6687 87
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#E04C5D"/>',
' <circle cx="25" cy="25" r="12" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('certification')
);
}
/**
* @test
*/
public function canReturnSkillVerificationButtonForSelf()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skill/10/0/3" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#32BE8C"/>',
' <circle cx="25" cy="25" r="12" fill="#32BE8C" stroke="white" stroke-width="2"/>',
' <path d="M67.412 22.537C67.37 22.607 67.3233 22.6607 67.272 22.698C67.2253 22.7307 67.167 22.747 67.097 22.747C67.0177 22.747 66.9243 22.7073 66.817 22.628C66.7097 22.5487 66.5743 22.4623 66.411 22.369C66.2523 22.271 66.0587 22.1823 65.83 22.103C65.606 22.0237 65.333 21.984 65.011 21.984C64.7077 21.984 64.4393 22.026 64.206 22.11C63.9773 22.1893 63.7837 22.299 63.625 22.439C63.471 22.579 63.3543 22.7447 63.275 22.936C63.1957 23.1227 63.156 23.3257 63.156 23.545C63.156 23.825 63.2237 24.0583 63.359 24.245C63.499 24.427 63.681 24.5833 63.905 24.714C64.1337 24.8447 64.3903 24.959 64.675 25.057C64.9643 25.1503 65.2583 25.2483 65.557 25.351C65.8603 25.4537 66.1543 25.5703 66.439 25.701C66.7283 25.827 66.985 25.988 67.209 26.184C67.4377 26.38 67.6197 26.6203 67.755 26.905C67.895 27.1897 67.965 27.5397 67.965 27.955C67.965 28.3937 67.8903 28.8067 67.741 29.194C67.5917 29.5767 67.3723 29.9103 67.083 30.195C66.7983 30.4797 66.446 30.7037 66.026 30.867C65.6107 31.0303 65.137 31.112 64.605 31.112C63.9517 31.112 63.359 30.9953 62.827 30.762C62.295 30.524 61.84 30.2043 61.462 29.803L61.854 29.159C61.8913 29.1077 61.9357 29.0657 61.987 29.033C62.043 28.9957 62.1037 28.977 62.169 28.977C62.2297 28.977 62.2973 29.0027 62.372 29.054C62.4513 29.1007 62.54 29.1613 62.638 29.236C62.736 29.3107 62.848 29.3923 62.974 29.481C63.1 29.5697 63.2423 29.6513 63.401 29.726C63.5643 29.8007 63.7487 29.8637 63.954 29.915C64.1593 29.9617 64.3903 29.985 64.647 29.985C64.969 29.985 65.256 29.9407 65.508 29.852C65.76 29.7633 65.9723 29.6397 66.145 29.481C66.3223 29.3177 66.4577 29.124 66.551 28.9C66.6443 28.676 66.691 28.4263 66.691 28.151C66.691 27.8477 66.621 27.6003 66.481 27.409C66.3457 27.213 66.166 27.0497 65.942 26.919C65.718 26.7883 65.4613 26.6787 65.172 26.59C64.8827 26.4967 64.5887 26.4033 64.29 26.31C63.9913 26.212 63.6973 26.1 63.408 25.974C63.1187 25.848 62.862 25.6847 62.638 25.484C62.414 25.2833 62.232 25.0337 62.092 24.735C61.9567 24.4317 61.889 24.0583 61.889 23.615C61.889 23.2603 61.9567 22.9173 62.092 22.586C62.232 22.2547 62.4327 21.9607 62.694 21.704C62.96 21.4473 63.2843 21.242 63.667 21.088C64.0543 20.934 64.4977 20.857 64.997 20.857C65.557 20.857 66.0657 20.9457 66.523 21.123C66.985 21.3003 67.391 21.557 67.741 21.893L67.412 22.537ZM74.2935 26.681C74.2935 26.3917 74.2515 26.128 74.1675 25.89C74.0882 25.6473 73.9692 25.4397 73.8105 25.267C73.6565 25.0897 73.4675 24.9543 73.2435 24.861C73.0195 24.763 72.7652 24.714 72.4805 24.714C71.8832 24.714 71.4095 24.889 71.0595 25.239C70.7142 25.5843 70.4995 26.065 70.4155 26.681H74.2935ZM75.3015 30.006C75.1475 30.1927 74.9632 30.356 74.7485 30.496C74.5339 30.6313 74.3029 30.7433 74.0555 30.832C73.8129 30.9207 73.5609 30.986 73.2995 31.028C73.0382 31.0747 72.7792 31.098 72.5225 31.098C72.0325 31.098 71.5799 31.0163 71.1645 30.853C70.7539 30.685 70.3969 30.4423 70.0935 30.125C69.7949 29.803 69.5615 29.4063 69.3935 28.935C69.2255 28.4637 69.1415 27.9223 69.1415 27.311C69.1415 26.8163 69.2162 26.3543 69.3655 25.925C69.5195 25.4957 69.7389 25.1247 70.0235 24.812C70.3082 24.4947 70.6559 24.2473 71.0665 24.07C71.4772 23.888 71.9392 23.797 72.4525 23.797C72.8772 23.797 73.2692 23.8693 73.6285 24.014C73.9925 24.154 74.3052 24.3593 74.5665 24.63C74.8325 24.896 75.0402 25.2273 75.1895 25.624C75.3389 26.016 75.4135 26.464 75.4135 26.968C75.4135 27.164 75.3925 27.2947 75.3505 27.36C75.3085 27.4253 75.2292 27.458 75.1125 27.458H70.3735C70.3875 27.906 70.4482 28.2957 70.5555 28.627C70.6675 28.9583 70.8215 29.236 71.0175 29.46C71.2135 29.6793 71.4469 29.845 71.7175 29.957C71.9882 30.0643 72.2915 30.118 72.6275 30.118C72.9402 30.118 73.2085 30.083 73.4325 30.013C73.6612 29.9383 73.8572 29.859 74.0205 29.775C74.1839 29.691 74.3192 29.614 74.4265 29.544C74.5385 29.4693 74.6342 29.432 74.7135 29.432C74.8162 29.432 74.8955 29.4717 74.9515 29.551L75.3015 30.006ZM78.232 20.689V31H76.986V20.689H78.232ZM80.7146 31V24.973L79.9306 24.882C79.8326 24.8587 79.751 24.8237 79.6856 24.777C79.625 24.7257 79.5946 24.6533 79.5946 24.56V24.049H80.7146V23.363C80.7146 22.957 80.7706 22.5977 80.8826 22.285C
' </svg></a>',
]),
$subject->getVerificationButton('self')
);
}
2020-09-22 11:16:59 +02:00
/**
* @test
*/
public function canReturnSkillSetVerificationLinkForEducational()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skillset/0/10/2',
$subject->getVerificationLink('education', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationLinkForBusiness()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skillset/0/10/4',
$subject->getVerificationLink('business', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationLinkForCertification()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skillset/0/10/1',
$subject->getVerificationLink('certification', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationLinkForSelf()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
'https://my.example.com/verify/skillup/skillset/0/10/3',
$subject->getVerificationLink('self', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationButtonForEducational()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skillset/0/10/2" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#4A89C4"/>',
' <path d="M68.469 29.894L68.462 31H62.281V20.969H68.462V22.075H63.639V25.407H67.545V26.471H63.639V29.894H68.469ZM74.3863 25.596C74.153 25.2833 73.901 25.0663 73.6303 24.945C73.3596 24.819 73.0563 24.756 72.7203 24.756C72.0623 24.756 71.556 24.9917 71.2013 25.463C70.8466 25.9343 70.6693 26.6063 70.6693 27.479C70.6693 27.941 70.709 28.3377 70.7883 28.669C70.8676 28.9957 70.9843 29.2663 71.1383 29.481C71.2923 29.691 71.4813 29.845 71.7053 29.943C71.9293 30.041 72.1836 30.09 72.4683 30.09C72.879 30.09 73.236 29.9967 73.5393 29.81C73.8473 29.6233 74.1296 29.3597 74.3863 29.019V25.596ZM75.6323 20.689V31H74.8903C74.713 31 74.601 30.9137 74.5543 30.741L74.4423 29.88C74.139 30.244 73.7936 30.538 73.4063 30.762C73.019 30.986 72.571 31.098 72.0623 31.098C71.6563 31.098 71.2876 31.021 70.9563 30.867C70.625 30.7083 70.3426 30.4773 70.1093 30.174C69.876 29.8707 69.6963 29.4927 69.5703 29.04C69.4443 28.5873 69.3813 28.067 69.3813 27.479C69.3813 26.9563 69.4513 26.471 69.5913 26.023C69.7313 25.5703 69.932 25.1783 70.1933 24.847C70.4546 24.5157 70.7743 24.2567 71.1523 24.07C71.535 23.8787 71.9643 23.783 72.4403 23.783C72.8743 23.783 73.2453 23.8577 73.5533 24.007C73.866 24.1517 74.1436 24.3547 74.3863 24.616V20.689H75.6323ZM83.4313 23.909V31H82.6893C82.5119 31 82.3999 30.9137 82.3533 30.741L82.2553 29.978C81.9473 30.3187 81.6019 30.594 81.2193 30.804C80.8366 31.0093 80.3979 31.112 79.9033 31.112C79.5159 31.112 79.1729 31.049 78.8743 30.923C78.5803 30.7923 78.3329 30.6103 78.1323 30.377C77.9316 30.1437 77.7799 29.8613 77.6773 29.53C77.5793 29.1987 77.5303 28.8323 77.5303 28.431V23.909H78.7763V28.431C78.7763 28.9677 78.8976 29.383 79.1403 29.677C79.3876 29.971 79.7633 30.118 80.2673 30.118C80.6359 30.118 80.9789 30.0317 81.2963 29.859C81.6183 29.6817 81.9146 29.439 82.1853 29.131V23.909H83.4313ZM90.3419 25.169C90.3046 25.2203 90.2673 25.26 90.2299 25.288C90.1926 25.316 90.1413 25.33 90.0759 25.33C90.0059 25.33 89.9289 25.302 89.8449 25.246C89.7609 25.1853 89.6559 25.12 89.5299 25.05C89.4086 24.98 89.2569 24.917 89.0749 24.861C88.8976 24.8003 88.6783 24.77 88.4169 24.77C88.0669 24.77 87.7589 24.833 87.4929 24.959C87.2269 25.0803 87.0029 25.2577 86.8209 25.491C86.6436 25.7243 86.5083 26.0067 86.4149 26.338C86.3263 26.6693 86.2819 27.0403 86.2819 27.451C86.2819 27.8803 86.3309 28.263 86.4289 28.599C86.5269 28.9303 86.6646 29.2103 86.8419 29.439C87.0239 29.663 87.2409 29.8357 87.4929 29.957C87.7496 30.0737 88.0366 30.132 88.3539 30.132C88.6573 30.132 88.9069 30.097 89.1029 30.027C89.2989 29.9523 89.4599 29.8707 89.5859 29.782C89.7166 29.6933 89.8239 29.614 89.9079 29.544C89.9966 29.4693 90.0829 29.432 90.1669 29.432C90.2696 29.432 90.3489 29.4717 90.4049 29.551L90.7549 30.006C90.6009 30.1973 90.4259 30.3607 90.2299 30.496C90.0339 30.6313 89.8216 30.7457 89.5929 30.839C89.3689 30.9277 89.1333 30.993 88.8859 31.035C88.6386 31.077 88.3866 31.098 88.1299 31.098C87.6866 31.098 87.2736 31.0163 86.8909 30.853C86.5129 30.6897 86.1839 30.454 85.9039 30.146C85.6239 29.8333 85.4046 29.4507 85.2459 28.998C85.0873 28.5453 85.0079 28.0297 85.0079 27.451C85.0079 26.9237 85.0803 26.436 85.2249 25.988C85.3743 25.54 85.5889 25.155 85.8689 24.833C86.1536 24.5063 86.5013 24.252 86.9119 24.07C87.3273 23.888 87.8033 23.797 88.3399 23.797C88.8393 23.797 89.2779 23.8787 89.6559 24.042C90.0386 24.2007 90.3769 24.427 90.6709 24.721L90.3419 25.169ZM95.9355 27.808C95.3615 27.8267 94.8715 27.8733 94.4655 27.948C94.0641 28.018 93.7351 28.1113 93.4785 28.228C93.2265 28.3447 93.0421 28.4823 92.9255 28.641C92.8135 28.7997 92.7575 28.977 92.7575 29.173C92.7575 29.3597 92.7878 29.5207 92.8485 29.656C92.9091 29.7913 92.9908 29.9033 93.0935 29.992C93.2008 30.076 93.3245 30.139 93.4645 30.181C93.6091 30.2183 93.7631 30.237 93.9265 30.237C94.1458 30.237 94.3465 30.216 94.5285 30.174C94.7105 30.1273 94.8808 30.062 95.0395 29.978C95.2028 29.894 95.3568 29.7937 95.5015 29.677C95.6508 29.5603 95.7955 29.4273 95.9355 29.278V27.808ZM91.9105 24.91C92.3025 24.532 92.7248 24.2497 93.1775 24.063C93.6301 23.8763 94.1318 23.783 94.6825 23.783C95.0791 23.783 95.4315 23.
' <circle cx="25" cy="25" r="12" fill="#4A89C4" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('education', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationButtonForBusiness()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skillset/0/10/4" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M65.802 29.922C66.1893 29.922 66.523 29.8777 66.803 29.789C67.083 29.7003 67.3117 29.5767 67.489 29.418C67.671 29.2547 67.804 29.0633 67.888 28.844C67.972 28.62 68.014 28.375 68.014 28.109C68.014 27.591 67.8297 27.1827 67.461 26.884C67.0923 26.5807 66.5393 26.429 65.802 26.429H63.632V29.922H65.802ZM63.632 22.04V25.463H65.424C65.8067 25.463 66.138 25.421 66.418 25.337C66.7027 25.253 66.936 25.1363 67.118 24.987C67.3047 24.8377 67.4423 24.658 67.531 24.448C67.6197 24.2333 67.664 24 67.664 23.748C67.664 23.1553 67.4867 22.7237 67.132 22.453C66.7773 22.1777 66.2267 22.04 65.48 22.04H63.632ZM65.48 20.969C66.096 20.969 66.6257 21.0297 67.069 21.151C67.517 21.2723 67.8833 21.445 68.168 21.669C68.4573 21.893 68.6697 22.1683 68.805 22.495C68.9403 22.817 69.008 23.181 69.008 23.587C69.008 23.8343 68.9683 24.0723 68.889 24.301C68.8143 24.525 68.7 24.735 68.546 24.931C68.392 25.127 68.196 25.3043 67.958 25.463C67.7247 25.617 67.4493 25.743 67.132 25.841C67.8693 25.981 68.4223 26.2447 68.791 26.632C69.1643 27.0147 69.351 27.5187 69.351 28.144C69.351 28.5687 69.2717 28.956 69.113 29.306C68.959 29.656 68.7303 29.957 68.427 30.209C68.1283 30.461 67.7597 30.657 67.321 30.797C66.8823 30.9323 66.383 31 65.823 31H62.281V20.969H65.48ZM76.7184 23.909V31H75.9764C75.7991 31 75.6871 30.9137 75.6404 30.741L75.5424 29.978C75.2344 30.3187 74.8891 30.594 74.5064 30.804C74.1237 31.0093 73.6851 31.112 73.1904 31.112C72.8031 31.112 72.4601 31.049 72.1614 30.923C71.8674 30.7923 71.6201 30.6103 71.4194 30.377C71.2187 30.1437 71.0671 29.8613 70.9644 29.53C70.8664 29.1987 70.8174 28.8323 70.8174 28.431V23.909H72.0634V28.431C72.0634 28.9677 72.1847 29.383 72.4274 29.677C72.6747 29.971 73.0504 30.118 73.5544 30.118C73.9231 30.118 74.2661 30.0317 74.5834 29.859C74.9054 29.6817 75.2017 29.439 75.4724 29.131V23.909H76.7184ZM82.824 25.078C82.768 25.1807 82.6817 25.232 82.565 25.232C82.495 25.232 82.4157 25.2063 82.327 25.155C82.2384 25.1037 82.1287 25.0477 81.998 24.987C81.872 24.9217 81.7204 24.8633 81.543 24.812C81.3657 24.756 81.1557 24.728 80.913 24.728C80.703 24.728 80.514 24.756 80.346 24.812C80.178 24.8633 80.0334 24.9357 79.912 25.029C79.7954 25.1223 79.7044 25.232 79.639 25.358C79.5784 25.4793 79.548 25.6123 79.548 25.757C79.548 25.939 79.5994 26.0907 79.702 26.212C79.8094 26.3333 79.9494 26.4383 80.122 26.527C80.2947 26.6157 80.4907 26.695 80.71 26.765C80.9294 26.8303 81.1534 26.9027 81.382 26.982C81.6154 27.0567 81.8417 27.1407 82.061 27.234C82.2804 27.3273 82.4764 27.444 82.649 27.584C82.8217 27.724 82.9594 27.8967 83.062 28.102C83.1694 28.3027 83.223 28.5453 83.223 28.83C83.223 29.1567 83.1647 29.46 83.048 29.74C82.9314 30.0153 82.7587 30.2557 82.53 30.461C82.3014 30.6617 82.0214 30.8203 81.69 30.937C81.3587 31.0537 80.976 31.112 80.542 31.112C80.0474 31.112 79.5994 31.0327 79.198 30.874C78.7967 30.7107 78.456 30.503 78.176 30.251L78.47 29.775C78.5074 29.7143 78.5517 29.6677 78.603 29.635C78.6544 29.6023 78.7197 29.586 78.799 29.586C78.883 29.586 78.9717 29.6187 79.065 29.684C79.1584 29.7493 79.2704 29.8217 79.401 29.901C79.5364 29.9803 79.6997 30.0527 79.891 30.118C80.0824 30.1833 80.3204 30.216 80.605 30.216C80.8477 30.216 81.06 30.1857 81.242 30.125C81.424 30.0597 81.5757 29.9733 81.697 29.866C81.8184 29.7587 81.907 29.635 81.963 29.495C82.0237 29.355 82.054 29.2057 82.054 29.047C82.054 28.851 82.0004 28.69 81.893 28.564C81.7904 28.4333 81.6527 28.3237 81.48 28.235C81.3074 28.1417 81.109 28.0623 80.885 27.997C80.6657 27.927 80.4394 27.8547 80.206 27.78C79.9774 27.7053 79.751 27.6213 79.527 27.528C79.3077 27.43 79.1117 27.3087 78.939 27.164C78.7664 27.0193 78.6264 26.842 78.519 26.632C78.4164 26.4173 78.365 26.1583 78.365 25.855C78.365 25.5843 78.421 25.3253 78.533 25.078C78.645 24.826 78.8084 24.6067 79.023 24.42C79.2377 24.2287 79.5014 24.077 79.814 23.965C80.1267 23.853 80.4837 23.797 80.885 23.797C81.3517 23.797 81.7694 23.8717 82.138 24.021C82.5114 24.1657 82.8334 24.3663 83.104 24.623L82.824 25.078ZM86.0667 23.909V31H84.8207V23.909H86.0667ZM86.3327 21.683C86.3327 21.8043 86.307 21.9187 86.2557 22.026C86.209
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#F7BF5D"/>',
' <circle cx="25" cy="25" r="12" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('business', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationButtonForCertification()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skillset/0/10/1" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M69.323 28.928C69.3977 28.928 69.463 28.9583 69.519 29.019L70.058 29.6C69.6473 30.076 69.148 30.447 68.56 30.713C67.9767 30.979 67.2697 31.112 66.439 31.112C65.7203 31.112 65.067 30.9883 64.479 30.741C63.891 30.489 63.3893 30.139 62.974 29.691C62.5587 29.2383 62.2367 28.697 62.008 28.067C61.7793 27.437 61.665 26.744 61.665 25.988C61.665 25.232 61.784 24.539 62.022 23.909C62.26 23.279 62.5937 22.7377 63.023 22.285C63.457 21.8323 63.975 21.4823 64.577 21.235C65.179 20.983 65.844 20.857 66.572 20.857C67.286 20.857 67.916 20.9713 68.462 21.2C69.008 21.4287 69.4887 21.739 69.904 22.131L69.456 22.754C69.428 22.8007 69.3907 22.8403 69.344 22.873C69.302 22.901 69.2437 22.915 69.169 22.915C69.085 22.915 68.9823 22.8707 68.861 22.782C68.7397 22.6887 68.581 22.586 68.385 22.474C68.189 22.362 67.944 22.2617 67.65 22.173C67.356 22.0797 66.9943 22.033 66.565 22.033C66.047 22.033 65.5733 22.124 65.144 22.306C64.7147 22.4833 64.3437 22.7423 64.031 23.083C63.723 23.4237 63.4827 23.839 63.31 24.329C63.1373 24.819 63.051 25.372 63.051 25.988C63.051 26.6133 63.1397 27.171 63.317 27.661C63.499 28.151 63.744 28.5663 64.052 28.907C64.3647 29.243 64.731 29.4997 65.151 29.677C65.5757 29.8543 66.033 29.943 66.523 29.943C66.8217 29.943 67.09 29.9267 67.328 29.894C67.5707 29.8567 67.7923 29.8007 67.993 29.726C68.1983 29.6513 68.3873 29.558 68.56 29.446C68.7373 29.3293 68.9123 29.1917 69.085 29.033C69.1643 28.963 69.2437 28.928 69.323 28.928ZM75.9478 26.681C75.9478 26.3917 75.9058 26.128 75.8218 25.89C75.7425 25.6473 75.6235 25.4397 75.4648 25.267C75.3108 25.0897 75.1218 24.9543 74.8978 24.861C74.6738 24.763 74.4195 24.714 74.1348 24.714C73.5375 24.714 73.0638 24.889 72.7138 25.239C72.3685 25.5843 72.1538 26.065 72.0698 26.681H75.9478ZM76.9558 30.006C76.8018 30.1927 76.6175 30.356 76.4028 30.496C76.1882 30.6313 75.9572 30.7433 75.7098 30.832C75.4672 30.9207 75.2152 30.986 74.9538 31.028C74.6925 31.0747 74.4335 31.098 74.1768 31.098C73.6868 31.098 73.2342 31.0163 72.8188 30.853C72.4082 30.685 72.0512 30.4423 71.7478 30.125C71.4492 29.803 71.2158 29.4063 71.0478 28.935C70.8798 28.4637 70.7958 27.9223 70.7958 27.311C70.7958 26.8163 70.8705 26.3543 71.0198 25.925C71.1738 25.4957 71.3932 25.1247 71.6778 24.812C71.9625 24.4947 72.3102 24.2473 72.7208 24.07C73.1315 23.888 73.5935 23.797 74.1068 23.797C74.5315 23.797 74.9235 23.8693 75.2828 24.014C75.6468 24.154 75.9595 24.3593 76.2208 24.63C76.4868 24.896 76.6945 25.2273 76.8438 25.624C76.9932 26.016 77.0678 26.464 77.0678 26.968C77.0678 27.164 77.0468 27.2947 77.0048 27.36C76.9628 27.4253 76.8835 27.458 76.7668 27.458H72.0278C72.0418 27.906 72.1025 28.2957 72.2098 28.627C72.3218 28.9583 72.4758 29.236 72.6718 29.46C72.8678 29.6793 73.1012 29.845 73.3718 29.957C73.6425 30.0643 73.9458 30.118 74.2818 30.118C74.5945 30.118 74.8628 30.083 75.0868 30.013C75.3155 29.9383 75.5115 29.859 75.6748 29.775C75.8382 29.691 75.9735 29.614 76.0808 29.544C76.1928 29.4693 76.2885 29.432 76.3678 29.432C76.4705 29.432 76.5498 29.4717 76.6058 29.551L76.9558 30.006ZM79.7813 25.33C80.0053 24.8447 80.2807 24.4667 80.6073 24.196C80.934 23.9207 81.333 23.783 81.8043 23.783C81.9537 23.783 82.096 23.7993 82.2313 23.832C82.3713 23.8647 82.495 23.916 82.6023 23.986L82.5113 24.917C82.4833 25.0337 82.4133 25.092 82.3013 25.092C82.236 25.092 82.1403 25.078 82.0143 25.05C81.8883 25.022 81.746 25.008 81.5873 25.008C81.3633 25.008 81.1627 25.0407 80.9853 25.106C80.8127 25.1713 80.6563 25.2693 80.5163 25.4C80.381 25.526 80.2573 25.6847 80.1453 25.876C80.038 26.0627 79.94 26.2773 79.8513 26.52V31H78.5983V23.909H79.3123C79.4477 23.909 79.541 23.9347 79.5923 23.986C79.6437 24.0373 79.6787 24.126 79.6973 24.252L79.7813 25.33ZM90.2779 31H89.0319V24.952H85.3779V29.208C85.3779 29.5067 85.4503 29.7283 85.5949 29.873C85.7396 30.0177 85.9263 30.09 86.1549 30.09C86.2856 30.09 86.3976 30.0737 86.4909 30.041C86.5889 30.0037 86.6729 29.964 86.7429 29.922C86.8129 29.88 86.8713 29.8427 86.9179 29.81C86.9693 29.7727 87.0136 29.754 87.0509 29.754C87.1163 29.754 87.1746 29.7937 87.2259 29.873L87.5899 30.468C87.3753 30.6687 87
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#E04C5D"/>',
' <circle cx="25" cy="25" r="12" stroke="white" stroke-width="2"/>',
' </svg></a>',
]),
$subject->getVerificationButton('certification', null, Link::SKILL_SET)
);
}
/**
* @test
*/
public function canReturnSkillSetVerificationButtonForSelf()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal(), 10);
static::assertSame(
implode(PHP_EOL, [
' <a href="https://my.example.com/verify/skillup/skillset/0/10/3" target="_blank">',
' <svg width="222" height="50" viewBox="0 0 222 50" fill="none" xmlns="http://www.w3.org/2000/svg">',
' <rect width="222" height="50" rx="3" fill="#F2F2F2"/>',
' <path d="M0 3C0 1.34315 1.34315 0 3 0H50V50H3C1.34315 50 0 48.6569 0 47V3Z" fill="#32BE8C"/>',
' <circle cx="25" cy="25" r="12" fill="#32BE8C" stroke="white" stroke-width="2"/>',
' <path d="M67.412 22.537C67.37 22.607 67.3233 22.6607 67.272 22.698C67.2253 22.7307 67.167 22.747 67.097 22.747C67.0177 22.747 66.9243 22.7073 66.817 22.628C66.7097 22.5487 66.5743 22.4623 66.411 22.369C66.2523 22.271 66.0587 22.1823 65.83 22.103C65.606 22.0237 65.333 21.984 65.011 21.984C64.7077 21.984 64.4393 22.026 64.206 22.11C63.9773 22.1893 63.7837 22.299 63.625 22.439C63.471 22.579 63.3543 22.7447 63.275 22.936C63.1957 23.1227 63.156 23.3257 63.156 23.545C63.156 23.825 63.2237 24.0583 63.359 24.245C63.499 24.427 63.681 24.5833 63.905 24.714C64.1337 24.8447 64.3903 24.959 64.675 25.057C64.9643 25.1503 65.2583 25.2483 65.557 25.351C65.8603 25.4537 66.1543 25.5703 66.439 25.701C66.7283 25.827 66.985 25.988 67.209 26.184C67.4377 26.38 67.6197 26.6203 67.755 26.905C67.895 27.1897 67.965 27.5397 67.965 27.955C67.965 28.3937 67.8903 28.8067 67.741 29.194C67.5917 29.5767 67.3723 29.9103 67.083 30.195C66.7983 30.4797 66.446 30.7037 66.026 30.867C65.6107 31.0303 65.137 31.112 64.605 31.112C63.9517 31.112 63.359 30.9953 62.827 30.762C62.295 30.524 61.84 30.2043 61.462 29.803L61.854 29.159C61.8913 29.1077 61.9357 29.0657 61.987 29.033C62.043 28.9957 62.1037 28.977 62.169 28.977C62.2297 28.977 62.2973 29.0027 62.372 29.054C62.4513 29.1007 62.54 29.1613 62.638 29.236C62.736 29.3107 62.848 29.3923 62.974 29.481C63.1 29.5697 63.2423 29.6513 63.401 29.726C63.5643 29.8007 63.7487 29.8637 63.954 29.915C64.1593 29.9617 64.3903 29.985 64.647 29.985C64.969 29.985 65.256 29.9407 65.508 29.852C65.76 29.7633 65.9723 29.6397 66.145 29.481C66.3223 29.3177 66.4577 29.124 66.551 28.9C66.6443 28.676 66.691 28.4263 66.691 28.151C66.691 27.8477 66.621 27.6003 66.481 27.409C66.3457 27.213 66.166 27.0497 65.942 26.919C65.718 26.7883 65.4613 26.6787 65.172 26.59C64.8827 26.4967 64.5887 26.4033 64.29 26.31C63.9913 26.212 63.6973 26.1 63.408 25.974C63.1187 25.848 62.862 25.6847 62.638 25.484C62.414 25.2833 62.232 25.0337 62.092 24.735C61.9567 24.4317 61.889 24.0583 61.889 23.615C61.889 23.2603 61.9567 22.9173 62.092 22.586C62.232 22.2547 62.4327 21.9607 62.694 21.704C62.96 21.4473 63.2843 21.242 63.667 21.088C64.0543 20.934 64.4977 20.857 64.997 20.857C65.557 20.857 66.0657 20.9457 66.523 21.123C66.985 21.3003 67.391 21.557 67.741 21.893L67.412 22.537ZM74.2935 26.681C74.2935 26.3917 74.2515 26.128 74.1675 25.89C74.0882 25.6473 73.9692 25.4397 73.8105 25.267C73.6565 25.0897 73.4675 24.9543 73.2435 24.861C73.0195 24.763 72.7652 24.714 72.4805 24.714C71.8832 24.714 71.4095 24.889 71.0595 25.239C70.7142 25.5843 70.4995 26.065 70.4155 26.681H74.2935ZM75.3015 30.006C75.1475 30.1927 74.9632 30.356 74.7485 30.496C74.5339 30.6313 74.3029 30.7433 74.0555 30.832C73.8129 30.9207 73.5609 30.986 73.2995 31.028C73.0382 31.0747 72.7792 31.098 72.5225 31.098C72.0325 31.098 71.5799 31.0163 71.1645 30.853C70.7539 30.685 70.3969 30.4423 70.0935 30.125C69.7949 29.803 69.5615 29.4063 69.3935 28.935C69.2255 28.4637 69.1415 27.9223 69.1415 27.311C69.1415 26.8163 69.2162 26.3543 69.3655 25.925C69.5195 25.4957 69.7389 25.1247 70.0235 24.812C70.3082 24.4947 70.6559 24.2473 71.0665 24.07C71.4772 23.888 71.9392 23.797 72.4525 23.797C72.8772 23.797 73.2692 23.8693 73.6285 24.014C73.9925 24.154 74.3052 24.3593 74.5665 24.63C74.8325 24.896 75.0402 25.2273 75.1895 25.624C75.3389 26.016 75.4135 26.464 75.4135 26.968C75.4135 27.164 75.3925 27.2947 75.3505 27.36C75.3085 27.4253 75.2292 27.458 75.1125 27.458H70.3735C70.3875 27.906 70.4482 28.2957 70.5555 28.627C70.6675 28.9583 70.8215 29.236 71.0175 29.46C71.2135 29.6793 71.4469 29.845 71.7175 29.957C71.9882 30.0643 72.2915 30.118 72.6275 30.118C72.9402 30.118 73.2085 30.083 73.4325 30.013C73.6612 29.9383 73.8572 29.859 74.0205 29.775C74.1839 29.691 74.3192 29.614 74.4265 29.544C74.5385 29.4693 74.6342 29.432 74.7135 29.432C74.8162 29.432 74.8955 29.4717 74.9515 29.551L75.3015 30.006ZM78.232 20.689V31H76.986V20.689H78.232ZM80.7146 31V24.973L79.9306 24.882C79.8326 24.8587 79.751 24.8237 79.6856 24.777C79.625 24.7257 79.5946 24.6533 79.5946 24.56V24.049H80.7146V23.363C80.7146 22.957 80.7706 22.5977 80.8826 22.285C
' </svg></a>',
]),
$subject->getVerificationButton('self', null, Link::SKILL_SET)
);
}
2020-09-22 11:16:59 +02:00
/**
* @test
*/
public function throwsExceptionIfNoSkillIdIsProvided()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal());
$this->expectExceptionMessage('No ID provided.');
2020-09-22 11:16:59 +02:00
$this->expectExceptionCode(1599723825);
$subject->getVerificationLink('education');
}
/**
* @test
*/
public function throwsExceptionIfInvalidTypeIsProvided()
{
$settings = $this->prophesize(Settings::class);
$settings->getMySkillDisplayUrl()->willReturn('https://my.example.com/verify');
$subject = new Link($settings->reveal());
$this->expectExceptionMessage('$type has to be "skill" or "skillset" but "invalid" given.');
$this->expectExceptionCode(1600774955);
$subject->getVerificationLink('education', null, 'invalid');
}
}